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
Sema: Improve MemberImportVisibility diagnostics for cross import overlays.
When `MemberImportVisibility` is enabled and a declaration from a cross import
overlay is diagnosed because it has not been imported, suggest imports of the
declaring and bystanding modules instead of the cross import overlay module
(which is an implementation detail).
Resolves rdar://149307959.
// expected-note 2 {{add import of module 'BystandingLibrary'}}
19
+
20
+
privatefunc test(){
21
+
returnsDeclaringTy().overlayMember() // expected-error {{instance method 'overlayMember()' is not available due to missing import of defining module 'BystandingLibrary'}}
22
+
returnsBystandingTy().overlayMember() // expected-error {{instance method 'overlayMember()' is not available due to missing import of defining module 'BystandingLibrary'}}
23
+
}
24
+
25
+
//--- OnlyBystanding.swift
26
+
27
+
import BystandingLibrary
28
+
// expected-note 2 {{add import of module 'DeclaringLibrary'}}
29
+
30
+
privatefunc test(){
31
+
returnsDeclaringTy().overlayMember() // expected-error {{instance method 'overlayMember()' is not available due to missing import of defining module 'DeclaringLibrary'}}
32
+
returnsBystandingTy().overlayMember() // expected-error {{instance method 'overlayMember()' is not available due to missing import of defining module 'DeclaringLibrary'}}
33
+
}
34
+
35
+
//--- NeitherDeclaringNorBystanding.swift
36
+
37
+
import Swift
38
+
// expected-note 2 {{add import of module 'BystandingLibrary'}}
39
+
// expected-note@-1 2 {{add import of module 'DeclaringLibrary'}}
40
+
41
+
privatefunc test(){
42
+
returnsDeclaringTy().overlayMember() // expected-error {{instance method 'overlayMember()' is not available due to missing imports of defining modules 'DeclaringLibrary' and 'BystandingLibrary'}}
43
+
returnsBystandingTy().overlayMember() // expected-error {{instance method 'overlayMember()' is not available due to missing imports of defining modules 'DeclaringLibrary' and 'BystandingLibrary'}}
0 commit comments