Error trying to build up a tuple of generic types via a result builder; works fine for non-generic types #78392
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
Trying to build up, via a result builder, a tuple of variadic length where the elements in the tuple are instances of a generic type with different generic parameters, doesn't compile, even though one would assume that this should be possible.
See the code below for an example.
Modifying the result builder to instead operate on a variadic generic struct acting as a wrapper around a tuple, and then "converting" it back to a tuple at the end (see here) works fine.
Alternatively, trying to simply build up a tuple of non-generic types (or, rather a tuple of arbitrary types where we don't know anything about the type; it might of course still be generic) also works absolutely fine (see here for an example of what i'm talking about).
So it appears that the issue here is trying to build up a tuple where a generic parameter pack is applied to the elements of the tuple?
I.e.: (pseudocode)
TupleBuilder<each T> -> (repeat each T)
TulpeBuilder<each T> -> (repeat X<each T>)
Reproduction
Expected behavior
This should work, since it's essentially just a combination of two language features that each should (and do) work on their own.
Environment
swift-driver version: 1.115.1 Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: