Skip to content

Commit 9ce34ab

Browse files
committed
Tests: Add a comment where warnings would be desired
We may want to add a similar logic from getImportAccessLevel where we determine the defining module in `diagnoseAndFixMissingImportForMember`. It should recommend to add the authoritative import, without considering those already present in the file. Then we can delete the `registerRequiredAccessLevelForModule(definingModule, accessLevel);` in `recordRequiredImportAccessLevelForDecl` and point to more superfluous public imports.
1 parent 9751be9 commit 9ce34ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/Sema/authoritative-import-priority.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public func useTypesC(a: FarClangType) {}
133133
//--- ExportedClient_FileA.swift
134134
/// Prefer the defining module.
135135
public import NotLib // expected-warning {{public import of 'NotLib' was not used in public declarations or inlinable code}}
136-
public import LibCore
136+
public import LibCore // We should warn here.
137137
public import Lib
138138

139139
public func useTypesA(a: ExportedType) {}
@@ -162,7 +162,7 @@ public func useTypesD(a: ExportedType) {}
162162

163163
//--- SwiftLibClient_FileA.swift
164164
/// Prefer the import matching public-module-name.
165-
public import SwiftPublicNameCore
165+
public import SwiftPublicNameCore // We should warn here.
166166
public import SwiftPublicName
167167

168168
public func useTypesA(a: SwiftStruct) {}

0 commit comments

Comments
 (0)