Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0122-rdar30965000.swift
Slava Pestov 8b59660143 GSB: Don't infer requirements from type constructors in a protocol inheritance clause
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.
2021-09-06 23:35:19 -04:00

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'}}