Skip to content

Commit 377ecf4

Browse files
committed
[Sema] Pass ModuleDecl directly to notes on imports with access-levels
1 parent 6d9779f commit 377ecf4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/swift/AST/DiagnosticsSema.def

+2-2
Original file line numberDiff line numberDiff line change
@@ -2332,12 +2332,12 @@ ERROR(access_level_conflict_with_exported,none,
23322332
(DeclAttribute, DeclAttribute))
23332333
NOTE(module_imported_here,none,
23342334
"module %0 imported as '%select{private|fileprivate|internal|package|%ERROR|%ERROR}1' here",
2335-
(Identifier, AccessLevel))
2335+
(const ModuleDecl*, AccessLevel))
23362336
NOTE(decl_import_via_here,none,
23372337
"%kind0 imported as "
23382338
"'%select{private|fileprivate|internal|package|%ERROR|%ERROR}1' "
23392339
"from %2 here",
2340-
(const ValueDecl *, AccessLevel, Identifier))
2340+
(const ValueDecl *, AccessLevel, const ModuleDecl*))
23412341

23422342
// Opaque return types
23432343
ERROR(opaque_type_invalid_constraint,none,

lib/Sema/TypeCheckAccess.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,11 @@ static void noteLimitingImport(ASTContext &ctx,
330330
diag::decl_import_via_here,
331331
VD,
332332
limitImport->accessLevel,
333-
limitImport->module.importedModule->getName());
333+
limitImport->module.importedModule);
334334
} else {
335-
ctx.Diags.diagnose(limitImport->accessLevelLoc, diag::module_imported_here,
336-
limitImport->module.importedModule->getName(),
337-
limitImport->accessLevel);
335+
ctx.Diags.diagnose(limitImport->accessLevelLoc, diag::module_imported_here,
336+
limitImport->module.importedModule,
337+
limitImport->accessLevel);
338338
}
339339
}
340340

0 commit comments

Comments
 (0)