Open NachoSoto opened 1 week ago
for future triage: note that the issue seems like it may be specific to the interaction with associated types. e.g. this compiles:
protocol P {
var prop: String? { get }
}
func f(_ c: [any P]) {
let _ = c.compactMap(\.prop)
}
but these do not:
protocol P {
associatedtype U
var prop: U? { get }
}
func f(_ c: [any P]) {
let _ = c.compactMap(\.prop)
}
protocol P<U> {
associatedtype U
var prop: U? { get }
}
func f(_ c: [any P<Int>]) {
let _ = c.compactMap(\.prop)
}
Reproduction
Stack dump
Expected behavior
Compiles
Environment