Not sure if this is a real limitation or a (known) bug.
protocol P {}
struct S<each T>: P {
let value: (repeat each T)
}
func s<each T>(_ value: repeat each T) -> S<repeat each T> {
S(value: (repeat each value))
}
func p<each T>(_ value: repeat each T) -> some P {
S(value: (repeat each value))
}
func noResult<each T>(_ value: repeat each T) {
_ = S(value: (repeat each value))
}
p and noResult functions crashes the compiler. I've tried Xcode 15.2 beta (15C5500c) and swift-5.10-DEVELOPMENT-SNAPSHOT-2023-12-21-a.xctoolchain, no luck. Can anyone enlighten me on what's wrong (with Swift or me)?
Whether or not there's an issue in your code, the compiler should not crash. Please report the bug.
A bug report can pretty much be just what you wrote here; "hey, I tried to compile the following code with this version of the compiler and it crashed ..."