Let all Promise<T> be friend of Task
Summary:
[Folly][coro] Let all `Promise<T>` be friend of `Task`.
The code would not compile:
```lang=c++
coro::Task<void> taskVoid() {
co_await task42();
co_return;
}
```
```
folly/experimental/coro/Promise.h:84:28: error: 'viaInline' is a private member of 'folly::coro::Task<int>'
return std::move(task).viaInline(executor_);
^
folly/experimental/coro/tests/CoroTest.cpp:40:3: note: in instantiation of function template specialization 'folly::coro::Promise<void>::await_transform<int>' requested here
co_await task42();
^
folly/experimental/coro/Task.h:60:13: note: declared private here
Future<T> viaInline(folly::Executor* executor) && {
^
```
Reviewed By: andriigrynenko
Differential Revision: D7178238
fbshipit-source-id: 7dca6834ac56f4c9bdb4d702996b51e932f2aae6
Showing
Please register or sign in to comment