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
Copy file name to clipboardExpand all lines: test/type/explicit_existential.swift
+13-8
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,10 @@ protocol Bar {
18
18
}
19
19
20
20
classBistro{
21
-
convenienceinit(_:Bar){self.init()} // expected-explicit-any-error{{use of protocol 'Bar' as a type must be written 'any Bar'}}{{23-26=any Bar}}
22
-
classfunc returnBar()->Bar{} // expected-explicit-any-error {{use of protocol 'Bar' as a type must be written 'any Bar'}}{{29-32=any Bar}}
21
+
convenienceinit(_:Bar){self.init()}
22
+
// expected-explicit-any-warning@-1 {{use of protocol 'Bar' as a type must be written 'any Bar'}}{{23-26=any Bar}}
23
+
classfunc returnBar()->Bar{}
24
+
// expected-explicit-any-warning@-1 {{use of protocol 'Bar' as a type must be written 'any Bar'}}{{29-32=any Bar}}
23
25
}
24
26
25
27
func useBarAsType(_ x:anyBar){}
@@ -217,7 +219,8 @@ protocol RawRepresentable {
217
219
enumE1:RawRepresentable{
218
220
typealiasRawValue=P1
219
221
220
-
varrawValue:P1{ // expected-explicit-any-error {{use of protocol 'P1' as a type must be written 'any P1'}}{{17-19=any P1}}
222
+
varrawValue:P1{
223
+
// expected-explicit-any-warning@-1 {{use of protocol 'P1' as a type must be written 'any P1'}}{{17-19=any P1}}
221
224
returnConcreteComposition()
222
225
}
223
226
}
@@ -315,9 +318,9 @@ enum EE : Equatable, any Empty { // expected-error {{raw type 'any Empty' is not
315
318
316
319
// Protocols from a serialized module (the standard library).
317
320
do{
318
-
// expected-explicit-any-error@+1 {{use of protocol 'Decodable' as a type must be written 'any Decodable'}}
321
+
// expected-explicit-any-warning@+1 {{use of protocol 'Decodable' as a type must be written 'any Decodable'}}
319
322
let _:Decodable
320
-
// expected-explicit-any-error@+1 {{use of 'Codable' (aka 'Decodable & Encodable') as a type must be written 'any Codable' (aka 'any Decodable & Encodable')}}
323
+
// expected-explicit-any-warning@+1 {{use of 'Codable' (aka 'Decodable & Encodable') as a type must be written 'any Codable' (aka 'any Decodable & Encodable')}}
0 commit comments