mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* [IRGen] Pass component generic sig when emitting key path component for external property rdar://101179225 When no generic environment was present, we passed nullptr, which is not correct when the property uses an external associated type, causing crashes in IRGen. In those cases, we have to pass the component generic sig instead. * Fix test
27 lines
499 B
Swift
27 lines
499 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -disable-availability-checking %s -emit-ir > /dev/null
|
|
|
|
struct Section: Identifiable {
|
|
let id: Int
|
|
let items: [any Item]
|
|
}
|
|
|
|
protocol Item: AnyObject, Identifiable {
|
|
}
|
|
|
|
protocol P {
|
|
}
|
|
|
|
struct Iter<D, I, C>: P where D : RandomAccessCollection, I : Hashable {
|
|
init(_ xs: D, id: KeyPath<D.Element, I>, f: (D.Element) -> C) {}
|
|
}
|
|
|
|
struct V {
|
|
var s: Section
|
|
var p: some P {
|
|
Iter(s.items, id: \.id) { x in
|
|
""
|
|
}
|
|
}
|
|
}
|