[promises] Generate a better error message for a common mistake

pull/35191/head
Craig Tiller 1 year ago
parent 6e18346c96
commit 0683ffe169
  1. 4
      src/core/lib/promise/detail/promise_like.h

@ -68,6 +68,10 @@ class PromiseLike {
private:
GPR_NO_UNIQUE_ADDRESS F f_;
static_assert(!std::is_void<typename std::result_of<F()>::type>::value,
"PromiseLike cannot be used with a function that returns void "
"- return Empty{} instead");
public:
// NOLINTNEXTLINE - internal detail that drastically simplifies calling code.
PromiseLike(F&& f) : f_(std::forward<F>(f)) {}

Loading…
Cancel
Save