You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Issue found by https://github.com/jvasileff (John Vasileff)
// This bug is NOT triggered when compiling with -O.
protocol BooleanProtocol {
var boolValue: Bool { get }
}
extension Bool : BooleanProtocol {
var boolValue: Bool { return self }
}
func f<T : BooleanProtocol>(_ b: T) {}
// expected-note@-1 {{required by global function 'f' where 'T' = 'any BooleanProtocol'}}
f(true as BooleanProtocol) // expected-error {{type 'any BooleanProtocol' cannot conform to 'BooleanProtocol'}} expected-note {{only concrete types such as structs, enums and classes can conform to protocols}}