mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The replacement types of the substitution map are either going to be contextual types, or interface types using some generic signature. There is no requirement that this generic signature is the generic signature of the type declaration itself. By using the generic signature of the type declaration, we could incorrectly canonicalize generic parameters to concrete types if the type itself was defined in a constrained extension, as in the test case here. Fixes <rdar://problem/65272763>.
22 lines
368 B
Swift
22 lines
368 B
Swift
// RUN: %target-swift-frontend -emit-ir %s
|
|
|
|
public struct S1<T1> {}
|
|
public extension S1 where T1 == Int {
|
|
public struct S2<T2> {
|
|
let value: T2
|
|
|
|
public init(value: T2) {
|
|
self.value = value
|
|
}
|
|
}
|
|
|
|
public init<T>(s: [S2<T>]) {
|
|
self.init()
|
|
|
|
s.forEach { _ in
|
|
|
|
}
|
|
}
|
|
}
|
|
|