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/Constraints/static_members_on_protocol_in_generic_context.swift
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -227,43 +227,43 @@ _ = P[q: ""].other
227
227
test(.doesntExist) // expected-error {{type 'P' has no member 'doesntExist'}}
228
228
test(.doesnt.exist()) // expected-error {{type 'P' has no member 'doesnt'}}
229
229
test(.invalidProp)
230
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'invalidProp'}}
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 {{cannot infer contextual base in reference to member 'invalidProp'}}
232
+
// expected-error@-1 {{contextual member reference to static property 'invalidProp' requires 'Self' constraint in the protocol extension}}
233
233
// expected-error@-2 {{value of type 'Int' has no member 'other'}}
234
234
test(.invalidMethod())
235
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'invalidMethod()'}}
235
+
// expected-error@-1 {{contextual member reference to static method 'invalidMethod()' requires 'Self' constraint in the protocol extension}}
236
236
test(.invalidMethod().other)
237
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'invalidMethod()'}}
237
+
// expected-error@-1 {{contextual member reference to static method 'invalidMethod()' requires 'Self' constraint in the protocol extension}}
238
238
// expected-error@-2 {{value of type 'Int' has no member 'other'}}
239
239
test(.generic(42))
240
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'generic'}}
240
+
// expected-error@-1 {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
241
241
test(.generic(42).other)
242
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'generic'}}
242
+
// expected-error@-1 {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
243
243
// expected-error@-2 {{value of type 'Int' has no member 'other'}}
244
-
test(.generic(S())) // expected-error {{cannot infer contextual base in reference to member 'generic'}}
245
-
test(.generic(G<Int>())) // expected-error {{cannot infer contextual base in reference to member 'generic'}}
246
-
test(.genericWithReqs([S()])) // expected-error {{cannot infer contextual base in reference to member 'genericWithReqs'}}
244
+
test(.generic(S())) // expected-error {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
245
+
test(.generic(G<Int>())) // expected-error {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
246
+
test(.genericWithReqs([S()])) // expected-error {{contextual member reference to static method 'genericWithReqs' requires 'Self' constraint in the protocol extension}}
247
247
test(.genericWithReqs([42]))
248
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'genericWithReqs'}}
248
+
// expected-error@-1 {{contextual member reference to static method 'genericWithReqs' requires 'Self' constraint in the protocol extension}}
249
249
test(.genericWithReqs(()))
250
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'genericWithReqs'}}
250
+
// expected-error@-1 {{contextual member reference to static method 'genericWithReqs' requires 'Self' constraint in the protocol extension}}
251
251
252
252
test_combo(.doesntExist) // expected-error {{reference to member 'doesntExist' cannot be resolved without a contextual type}}
253
253
test_combo(.doesnt.exist()) // expected-error {{reference to member 'doesnt' cannot be resolved without a contextual type}}
254
254
test_combo(.invalidProp)
255
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'invalidProp'}}
255
+
// expected-error@-1 {{contextual member reference to static property 'invalidProp' requires 'Self' constraint in the protocol extension}}
256
256
test_combo(.invalidMethod())
257
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'invalidMethod()'}}
257
+
// expected-error@-1 {{contextual member reference to static method 'invalidMethod()' requires 'Self' constraint in the protocol extension}}
258
258
test_combo(.generic(42))
259
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'generic'}}
260
-
test_combo(.generic(S())) // expected-error {{cannot infer contextual base in reference to member 'generic'}}
261
-
test_combo(.generic(G<Int>())) // expected-error {{cannot infer contextual base in reference to member 'generic'}}
262
-
test_combo(.genericWithReqs([S()])) // expected-error {{cannot infer contextual base in reference to member 'genericWithReqs'}}
259
+
// expected-error@-1 {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
260
+
test_combo(.generic(S())) // expected-error {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
261
+
test_combo(.generic(G<Int>())) // expected-error {{contextual member reference to static method 'generic' requires 'Self' constraint in the protocol extension}}
262
+
test_combo(.genericWithReqs([S()])) // expected-error {{contextual member reference to static method 'genericWithReqs' requires 'Self' constraint in the protocol extension}}
263
263
test_combo(.genericWithReqs([42]))
264
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'genericWithReqs'}}
264
+
// expected-error@-1 {{contextual member reference to static method 'genericWithReqs' requires 'Self' constraint in the protocol extension}}
265
265
test_combo(.genericWithReqs(()))
266
-
// expected-error@-1 {{cannot infer contextual base in reference to member 'genericWithReqs'}}
266
+
// expected-error@-1 {{contextual member reference to static method 'genericWithReqs' requires 'Self' constraint in the protocol extension}}
267
267
268
268
protocolZ{
269
269
associatedtypeT=Int
@@ -297,5 +297,5 @@ extension TestWithAssoc where U == Int { // expected-note {{missing same-type re
297
297
298
298
func test_fixit_with_where_clause(){
299
299
func test_assoc<T:TestWithAssoc>(_:T){}
300
-
test_assoc(.intVar) // expected-error {{cannot infer contextual base in reference to member 'intVar'}}
300
+
test_assoc(.intVar) // expected-error {{contextual member reference to static property 'intVar' requires 'Self' constraint in the protocol extension}}
0 commit comments