Skip to content

Commit 2241bf5

Browse files
committed
Diagnostics: Ignore public-module-name for warnings about unused imports
1 parent 3721a0a commit 2241bf5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,10 +2672,10 @@ NOTE(add_preconcurrency_to_conformance,none,
26722672
"add '@preconcurrency' to the %0 conformance to defer isolation checking to run time", (DeclName))
26732673
WARNING(remove_public_import,none,
26742674
"public import of %0 was not used in public declarations or inlinable code",
2675-
(const ModuleDecl *))
2675+
(Identifier))
26762676
WARNING(remove_package_import,none,
26772677
"package import of %0 was not used in package declarations",
2678-
(const ModuleDecl *))
2678+
(Identifier))
26792679
WARNING(public_decl_needs_sendable,none,
26802680
"public %kind0 does not specify whether it is 'Sendable' or not",
26812681
(const ValueDecl *))

lib/Sema/TypeCheckAccess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,7 @@ void swift::diagnoseUnnecessaryPublicImports(SourceFile &SF) {
25522552
diag::remove_package_import;
25532553
auto inFlight = ctx.Diags.diagnose(import.importLoc,
25542554
diagId,
2555-
importedModule);
2555+
importedModule->getName());
25562556

25572557
if (levelUsed == AccessLevel::Package) {
25582558
inFlight.fixItReplace(import.accessLevelRange, "package");

0 commit comments

Comments
 (0)