mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When an otherwise abstract conformance constraint is derived from a concrete conformance, retain the abstract conformance by removing the requirement source that involves the concrete conformance. This eliminates our reliance on the concrete conformance, which is not retained as part of the generic signature. Fixes rdar://problem/31163470 and rdar://problem/31520386.
24 lines
327 B
Swift
24 lines
327 B
Swift
// RUN: %target-swift-frontend -primary-file %s -emit-ir
|
|
|
|
protocol C {
|
|
associatedtype I
|
|
}
|
|
|
|
protocol PST {
|
|
associatedtype LT : C
|
|
}
|
|
|
|
protocol SL {
|
|
associatedtype S : PST
|
|
}
|
|
|
|
struct PEN<_S : PST> : SL {
|
|
typealias S = _S
|
|
let l: _S.LT.I
|
|
}
|
|
|
|
struct PE<N : SL> {
|
|
let n: N
|
|
static func c<S>(_: PE<N>) where N == PEN<S> {}
|
|
}
|