mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This enabled a gross idiom that should not have been allowed in the first place:
typealias G<T> = Any where T : P
protocol P {}
protocol Q : G<Self> {} // Q inherits from P now!
I'd like to ban this, assuming nothing is actually relying on this behavior.
10 lines
232 B
Swift
10 lines
232 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
protocol P {
|
|
associatedtype A
|
|
}
|
|
struct Straint<C: P> where C.A : P {
|
|
typealias X = Any
|
|
}
|
|
protocol Q : Straint<Self>.X {} // expected-error {{type 'Self' does not conform to protocol 'P'}}
|