fix(exec): allow any_sender completion signatures through reference types - #2244
Open
alwaysprince05 wants to merge 1 commit into
Open
Conversation
…ypes Fixes NVIDIA#2101. When exec::sequence has 3+ senders, the recursive completion-signature computation in __seq::__sndr produces reference- qualified sender types (e.g. const any_sender&). The previous constraint `derived_from<Self, _interface_>` on isender::interface::get_completion_signatures() rejected reference types because std::derived_from is never satisfied by a reference. Decay Self before the derived_from check. get_completion_signatures is a static consteval function that returns type information only — it never connects the sender, so the cvref-qualifiers on Self are irrelevant here. This restores the ability to use type-erased any_senders inside sequences of 3+ senders. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
ericniebler
requested changes
Aug 31, 2026
|
|
||
| template <__std::derived_from<_interface_> Self, class... Env> | ||
| template <class Self, class... Env> | ||
| requires __std::derived_from<__decay_t<Self>, _interface_> |
Collaborator
There was a problem hiding this comment.
i'm afraid this fix is wrong too. if sender_in<S, E> is true, then a sender of type S should be connect-able with a receiver whose environment has type E. after this change, that is no longer true for any_sender. only rvalue any_senders can be connected, so any_sender::get_completion_signatures is right to reject lvalue any_senders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2101 (supersedes #2223 with a simpler, correct approach).
When
exec::sequencehas 3+ senders, the recursive completion-signaturecomputation in
__seq::__sndrproduces reference-qualified sender types(e.g.
const any_sender&). The constraintderived_from<Self, _interface_>on
_isender::_interface_::get_completion_signatures()rejects these becausestd::derived_fromis never satisfied by a reference type.Fix
Decay
Selfbefore thederived_fromcheck. This is a 2-line change inany_sender_of.hpp:get_completion_signaturesis a static consteval function that returnstype information only — it never connects the sender, so the cvref-qualifiers
on
Selfare irrelevant. Theconnectmember function remains&&-qualifiedand still rejects const lvalue references.
Why this approach
The earlier PR #2223 changed
__attrsto decay children types and__sequence.hppto decay the first sender for signature queries. Eric notedthat "the cvref-ness of the first sender matters" for
connect(line 328).Our fix avoids touching
__sequence.hppentirely — the constraint was simplytoo restrictive for a function that only computes types.
Verified
🤖 Generated with Codebuff
Co-Authored-By: Codebuff noreply@codebuff.com