mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Offer solution to silence inconsistent import access-level warnings
Adoption InternalImportsByDefault provides a safe access-level by default to imports, as such ambiguities are not a risk and showing this warning is superflous. When this warning is shown, make sure we note this alternative.
This commit is contained in:
@@ -1075,11 +1075,16 @@ CheckInconsistentAccessLevelOnImport::evaluate(
|
||||
auto &diags = mod->getDiags();
|
||||
{
|
||||
InFlightDiagnostic error =
|
||||
diags.diagnose(implicitImport, diag::inconsistent_implicit_access_level_on_import,
|
||||
implicitImport->getModule()->getName(), otherAccessLevel);
|
||||
diags.diagnose(implicitImport,
|
||||
diag::inconsistent_implicit_access_level_on_import,
|
||||
implicitImport->getModule()->getName(),
|
||||
otherAccessLevel);
|
||||
error.fixItInsert(implicitImport->getStartLoc(),
|
||||
diag::inconsistent_implicit_access_level_on_import_fixit,
|
||||
otherAccessLevel);
|
||||
error.flush();
|
||||
diags.diagnose(implicitImport,
|
||||
diag::inconsistent_implicit_access_level_on_import_silence);
|
||||
}
|
||||
|
||||
SourceLoc accessLevelLoc = otherImport->getStartLoc();
|
||||
|
||||
Reference in New Issue
Block a user