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
[Tests] Update swiftinterface imports Swift 6 test
Update the test for imports defaulting to internal by adding the
explicit `public` modifier on all imports and the expected warnings.
Modernized a test somehow as it can't use previously shared files.
This revealed an issue with the warning about superfluous imports on
imports of submodules. I've marked one of them as a FIXME as it will
require a fix in the diagnostic.
// RUN: %FileCheck -implicit-check-not BAD -check-prefix CHECK-6 %s < %t.swiftinterface
13
17
14
-
@_exportedimport empty // expected-warning {{module 'empty' was not compiled with library evolution support; using it means binary compatibility for 'main' can't be guaranteed}}
15
-
@_exportedimport emptyButWithLibraryEvolution
16
-
import B.B2
17
-
importfunc C.c // expected-warning {{scoped imports are not yet supported in module interfaces}}
18
+
//--- empty.swift
19
+
20
+
//--- main.swift
21
+
@_exportedpublicimport resilient // expected-warning {{public import of 'resilient' was not used in public declarations or inlinable code}}
22
+
publicimport B.B2 // expected-warning {{public import of 'B2' was not used in public declarations or inlinable code}}
23
+
// expected-warning @-1 {{public import of 'B' was not used in public declarations or inlinable code}}
24
+
// FIXME: We don't want this last warning.
25
+
26
+
publicimportfunc C.c // expected-warning {{public import of 'C' was not used in public declarations or inlinable code}}
27
+
// expected-warning @-1 {{scoped imports are not yet supported in module interfaces}}
18
28
import D
19
29
@_implementationOnlyimport Secret_BAD
20
30
21
31
@_implementationOnlyimport NotSoSecret // expected-note {{imported as implementation-only here}}
22
-
import NotSoSecret2 // expected-warning {{'NotSoSecret2' inconsistently imported as implementation-only}}
32
+
publicimport NotSoSecret2 // expected-warning {{'NotSoSecret2' inconsistently imported as implementation-only}}
33
+
// expected-warning @-1 {{public import of 'NotSoSecret2' was not used in public declarations or inlinable code}}
34
+
35
+
//--- main-other.swift
36
+
publicimport A // expected-warning {{public import of 'A' was not used in public declarations or inlinable code}}
37
+
publicimport B.B3 // expected-warning {{public import of 'B3' was not used in public declarations or inlinable code}}
38
+
// expected-warning @-1 {{public import of 'B' was not used in public declarations or inlinable code}}
39
+
publicimport D // expected-warning {{public import of 'D' was not used in public declarations or inlinable code}}
40
+
41
+
publicimport NotSoSecret // expected-warning {{'NotSoSecret' inconsistently imported as implementation-only}}
42
+
// expected-warning @-1 {{public import of 'NotSoSecret' was not used in public declarations or inlinable code}}
43
+
@_implementationOnlyimport NotSoSecret2 // expected-note {{imported as implementation-only here}}
44
+
//--- clientWithError.swift
45
+
@_exportedpublicimport nonResilient // expected-error {{module 'nonResilient' was not compiled with library evolution support; using it means binary compatibility for 'clientWithError' can't be guaranteed}}
46
+
// expected-warning @-1 {{public import of 'nonResilient' was not used in public declarations or inlinable code}}
0 commit comments