mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Conditional conformances aren't quite ready yet for Swift 4.1, so introduce the flag `-enable-experimental-conditional-conformances` to enable conditional conformaces, and an error when one declares a conditional conformance without specifying the flag. Add this flag when building the standard library (which will vend conditional conformances) and to all of the tests that need it. Fixes rdar://problem/35728337.
18 lines
362 B
Swift
18 lines
362 B
Swift
// RUN: %target-typecheck-verify-swift -enable-experimental-conditional-conformances -typecheck %s -verify
|
|
|
|
// rdar://problem/35480952
|
|
|
|
postfix operator %%%
|
|
protocol P {
|
|
static postfix func %%%(lhs: Self)
|
|
}
|
|
protocol Q {}
|
|
struct Foo<T> {}
|
|
extension Foo: P where T : Q {
|
|
static postfix func %%%(lhs: Foo<T>) {}
|
|
}
|
|
|
|
func useIt<T: Q>(_: T.Type) {
|
|
Foo<T>()%%%
|
|
}
|