Skip to content

connect(let_value) is not constrained enough #630

@glebov-andrey

Description

@glebov-andrey

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:

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<member_t<Sender, Predecessor>, predecessor_receiver<...>>.
So when async_scope checks requires sender_to<const Sender&, remove_cvref_t<Receiver>> it tries to instantiate let_value's connect which of course fails inside operation on connect_result_t<const Sender &, predecessor_receiver>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions