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
// expected-error@-1 {{type '() -> Int' cannot conform to 'Hashable'}} expected-note@-1 {{only concrete types such as structs, enums and classes can conform to protocols}}
extensionP{ // expected-note 12 {{missing same-type requirement on 'Self'}} {{12-12= where Self == <#Type#>}}
178
+
extensionP{ // expected-note 13 {{missing same-type requirement on 'Self'}} {{12-12= where Self == <#Type#>}}
179
179
staticfunc generic<T>(_:T)->T{fatalError()}
180
180
staticfunc genericWithReqs<T:Collection, Q>(_:T)->Qwhere T.Element ==Q{ // expected-note {{in call to function 'genericWithReqs'}} expected-note {{required by static method 'genericWithReqs' where 'T' = '()'}}
181
181
fatalError()
182
182
}
183
183
}
184
184
185
-
extensionP{ // expected-note 4 {{missing same-type requirement on 'Self'}}
185
+
extensionP{ // expected-note 6 {{missing same-type requirement on 'Self'}}
186
186
staticvarinvalidProp:Int{42}
187
187
staticvarselfProp:Self{fatalError()}
188
188
staticfunc invalidMethod()->Int{42}
@@ -224,20 +224,23 @@ _ = P[q: ""].other
224
224
// expected-error@-1 {{static member 'subscript' cannot be used on protocol metatype '(any P).Type'}}
225
225
// expected-error@-2 {{value of type 'Int' has no member 'other'}}
226
226
227
-
test(.doesntExist) // expected-error {{reference to member 'doesntExist' cannot be resolved without a contextual type}}
228
-
test(.doesnt.exist()) // expected-error {{reference to member 'doesnt' cannot be resolved without a contextual type}}
227
+
test(.doesntExist) // expected-error {{type 'P' has no member 'doesntExist'}}
228
+
test(.doesnt.exist()) // expected-error {{type 'P' has no member 'doesnt'}}
229
229
test(.invalidProp)
230
230
// expected-error@-1 {{contextual member reference to static property 'invalidProp' requires 'Self' constraint in the protocol extension}}
231
231
test(.invalidProp.other)
232
-
// expected-error@-1 {{type '_Copyable' has no member 'invalidProp'}}
232
+
// expected-error@-1 {{contextual member reference to static property 'invalidProp' requires 'Self' constraint in the protocol extension}}
233
+
// expected-error@-2 {{value of type 'Int' has no member 'other'}}
233
234
test(.invalidMethod())
234
235
// expected-error@-1 {{contextual member reference to static method 'invalidMethod()' requires 'Self' constraint in the protocol extension}}
235
236
test(.invalidMethod().other)
236
-
// expected-error@-1 {{type '_Copyable' has no member 'invalidMethod'}}
237
+
// expected-error@-1 {{contextual member reference to static method 'invalidMethod()' requires 'Self' constraint in the protocol extension}}
238
+
// expected-error@-2 {{value of type 'Int' has no member 'other'}}
237
239
test(.generic(42))
238
240
// expected-error@-1 {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
239
241
test(.generic(42).other)
240
-
// expected-error@-1 {{type '_Copyable' has no member 'generic'}}
242
+
// expected-error@-1 {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
243
+
// expected-error@-2 {{value of type 'Int' has no member 'other'}}
241
244
test(.generic(S())) // expected-error {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
242
245
test(.generic(G<Int>())) // expected-error {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
243
246
test(.genericWithReqs([S()])) // expected-error {{contextual member reference to static method 'genericWithReqs' requires 'Self' constraint in the protocol extension}}
0 commit comments