We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3a1a4d commit d9e7ddfCopy full SHA for d9e7ddf
test/Constraints/static_members_on_protocol_in_generic_context.swift
@@ -363,3 +363,18 @@ do {
363
func testSomeMarkerProto<T: SomeMarkerProto>(_: T) {}
364
testSomeMarkerProto(.answer())
365
}
366
+
367
+// Make sure we diagnose something for instance properties as well
368
+extension P {
369
+ var instanceProp: S { S() }
370
+}
371
372
+extension P where Self == S {
373
+ var instanceProp2: S { S() }
374
375
376
+test(.instanceProp)
377
+// expected-error@-1 {{instance member 'instanceProp' cannot be used on type 'P'}}
378
+test(.instanceProp2)
379
+// expected-error@-1 {{instance member 'instanceProp2' cannot be used on type 'P'}}
380
+// expected-error@-2 {{property 'instanceProp2' requires the types 'Self' and 'S' be equivalent}}
0 commit comments