facebookexperimental / facebookexperimental/libunifex
`connect(let_value)` is not constrained enough
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 210
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
There appears to be an issue with `let_value` wrapping single-shot (move only) senders, when the resulting sender is passed to `spawn_detached`.
The following code doesn't compile:
```c++
unifex::any_sender_of<> s = unifex::just();
auto a1 = std::move(s) | unifex::let_value([]() { return unifex::just(); });
auto scope = unifex::v2::async_scope{};
unifex::spawn_detached(std::move(a1), scope);
```
As far as I understand, the problem is that `let_value`'s `connect` function is not constrained on `sender_to, predecessor_receiver<...>>`.
So when `async_scope` checks `requires sender_to>` it tries to instantiate `let_value`'s `connect` which of course fails inside `operation` on `connect_result_t`.
Contributor guide
Assessment
This issue has not been assessed yet.