Files
swift-mirror/test/Generics/conditional_conformances_operators.swift
Doug Gregor b59c30c1af [SE-0143] Put conditional conformances behind an "experimental" flag.
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.
2017-11-28 16:01:51 -08:00

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>()%%%
}