Skip to content

stdexec::spawn_future compilation failure with counting scope #1948

@maxbachmann

Description

@maxbachmann
stdexec::task<void> test()
{
    co_return;
}

stdexec::task<void> test2(stdexec::counting_scope &scope)
{
    co_await stdexec::spawn_future(test(), scope.get_token());
}

doesn't compile

install/debug/vendor/include/stdexec/__detail/__receivers.hpp:123:22:   required by the constraints of 'template<class _Receiver, class _Error>  requires (__set_error_member<_Receiver, _Error>) || (__tag_invocable<stdexec::set_error_t, _Receiver, _Error>) constexpr void stdexec::set_error_t::operator()(_Receiver&&, _Error&&) const'
install/debug/vendor/include/stdexec/__detail/__receivers.hpp:120:13: note: no operand of the disjunction is satisfied
  119 |       requires __set_error_member<_Receiver, _Error>
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  120 |             || __tag_invocable<set_error_t, _Receiver, _Error>
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It does compile with a simple_counting_scope. Using a stdexec::just() instead of the coroutine task also works as expected.

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