Fix error_types in dematerialize sender #609
Open
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.
Hiyo, I found what looks like a bug in the
dematerialize
sender.The issue is here: #611
To summarize
error_types
of a sender created bydematerialize
is usually an invalid type. For example the following code:(here on godbolt)
fails to compile and gives the error
error: no type named 'type' in 'struct unifex::single_type<>'
When we use
std::conditional_t
to filter the source sender'svalue_types
into ones that start withset_error
, sometimes thefalse
branch type isn't valid.I think the easiest solution is to add a layer of indirection so that the template argument to
tuple
isn't evaluated when the condition is false, which I've done here.After this the compiler complained about a missing
::type
so I updated that and switched a::type
to_t
for consistency.