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
func testConstraintAlias(x:Constraint){} // expected-error{{use of 'Constraint' (aka 'Input') as a type must be written 'any Constraint'}}{{29-39=any Constraint}}
282
+
typealiasConstraintB=Input&InputB
283
+
284
+
//expected-error@+2{{use of 'Constraint' (aka 'Input') as a type must be written 'any Constraint' (aka 'any Input')}}
285
+
//expected-error@+1 {{use of 'ConstraintB' (aka 'Input & InputB') as a type must be written 'any ConstraintB' (aka 'any Input & InputB')}}
@@ -278,7 +311,9 @@ enum EE : Equatable, any Empty { // expected-error {{raw type 'any Empty' is not
278
311
279
312
// Protocols from a serialized module (the standard library).
280
313
do{
314
+
// expected-explicit-any-error@+1 {{use of protocol 'Decodable' as a type must be written 'any Decodable'}}
281
315
let _:Decodable
316
+
// expected-explicit-any-error@+1 {{use of 'Codable' (aka 'Decodable & Encodable') as a type must be written 'any Codable' (aka 'any Decodable & Encodable')}}
282
317
let _:Codable
283
318
}
284
319
@@ -421,8 +456,9 @@ func testAnyFixIt() {
421
456
let _:(~Copyable)?
422
457
// expected-error@+1 {{use of protocol 'HasAssoc' as a type must be written 'any HasAssoc'}}{{10-18=(any HasAssoc)}}
423
458
let _:HasAssoc!
424
-
// expected-error@+2 {{type '(any Copyable)?' cannot be suppressed}}
425
-
// expected-warning@+1 {{using '!' is not allowed here; treating this as '?' instead}}
459
+
// expected-default-swift-mode-warning@+3 {{using '!' is not allowed here; treating this as '?' instead}}
460
+
// expected-swift-6-error@+2 {{using '!' is not allowed here; perhaps '?' was intended?}} {{19-20=?}}
461
+
// expected-error@+1 {{type '(any Copyable)?' cannot be suppressed}}
426
462
let _:~Copyable!
427
463
// expected-error@+1 {{constraint that suppresses conformance requires 'any'}}{{11-20=any ~Copyable}}
0 commit comments