Skip to content

Commit 4237a97

Browse files
committed
Sema: update other tests affected by the new inconsistent imports diagnostics
1 parent 73904ec commit 4237a97

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

test/Sema/access-level-import-inconsistencies.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ public struct LibType {}
2424
// RUN: -package-name package -verify
2525
//--- OneFile_AllExplicit.swift
2626
public import Lib // expected-warning {{public import of 'Lib' was not used in public declarations or inlinable code}}
27+
// expected-note @-1 4 {{imported 'public' here}}
2728
package import Lib // expected-warning {{package import of 'Lib' was not used in package declarations}}
29+
// expected-warning @-1 {{module 'Lib' is imported as 'public' from the same file; this 'package' access level will be ignored}}
2830
internal import Lib
31+
// expected-warning @-1 {{module 'Lib' is imported as 'public' from the same file; this 'internal' access level will be ignored}}
2932
fileprivate import Lib
33+
// expected-warning @-1 {{module 'Lib' is imported as 'public' from the same file; this 'fileprivate' access level will be ignored}}
3034
private import Lib
35+
// expected-warning @-1 {{module 'Lib' is imported as 'public' from the same file; this 'private' access level will be ignored}}
3136

3237
// RUN: %target-swift-frontend -typecheck %t/ManyFiles_AllExplicit_File?.swift -I %t \
3338
// RUN: -package-name package -verify

test/Sema/superfluously-public-imports.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ public import ExtendedDefinitionNonPublic // expected-warning {{public import of
122122

123123
/// Repeat some imports to make sure we report all of them.
124124
public import UnusedImport // expected-warning {{public import of 'UnusedImport' was not used in public declarations or inlinable code}} {{1-8=}}
125+
// expected-note @-1 {{imported 'public' here}}
125126
public import UnusedImport // expected-warning {{public import of 'UnusedImport' was not used in public declarations or inlinable code}} {{1-8=}}
126127
package import UnusedImport // expected-warning {{package import of 'UnusedImport' was not used in package declarations}} {{1-9=}}
128+
// expected-warning @-1 {{module 'UnusedImport' is imported as 'public' from the same file; this 'package' access level will be ignored}}
127129

128130
package import UnusedPackageImport // expected-warning {{package import of 'UnusedPackageImport' was not used in package declarations}} {{1-9=}}
129131
public import ImportNotUseFromAPI // expected-warning {{public import of 'ImportNotUseFromAPI' was not used in public declarations or inlinable code}} {{1-8=}}

0 commit comments

Comments
 (0)