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
Add MemberImportVisibility tests for inherited members of classes.
Create some test cases that demonstrate MemberImportVisibility behavior with respect referencing inherited members. There are already tests that demonstrate overrides, but nothing seemed to show the behavior when referencing an inherted member through a derived type. I wanted to verify this behavior so I wrote a test to demonstrate it. It seems reasonable to check-in the test to ensure the behavior remains consistent.
// expected-member-visibility-note 15{{add import of module 'members_B'}}{{1-1=internal import members_B\n}}
10
+
// expected-member-visibility-note 16{{add import of module 'members_B'}}{{1-1=internal import members_B\n}}
11
11
12
12
13
13
func testExtensionMembers(x:X, y:Y<Z>){
@@ -93,3 +93,9 @@ class DerivedFromClassInC: DerivedClassInC {
93
93
}
94
94
95
95
structConformsToProtocolInA:ProtocolInA{} // expected-member-visibility-error{{type 'ConformsToProtocolInA' does not conform to protocol 'ProtocolInA'}} expected-member-visibility-note {{add stubs for conformance}}
96
+
97
+
func testDerivedMethodAccess(){
98
+
DerivedClassInC().methodInC()
99
+
DerivedClassInC().methodInB() // expected-member-visibility-error{{instance method 'methodInB()' is not available due to missing import of defining module 'members_B'}}
0 commit comments