fix Issue 18528 - dmd should deduplicate identical errors (#15312)

This commit is contained in:
Walter Bright 2023-07-03 01:32:23 -07:00 committed by GitHub
parent a88e1335f7
commit ae23672059
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -1459,9 +1459,12 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
if (sym)
{
import dmd.access : symbolIsVisible;
if (!symbolIsVisible(sc, sym))
if (!symbolIsVisible(sc, sym) && !sym.errors)
{
imp.mod.error(imp.loc, "member `%s` is not visible from module `%s`",
imp.names[i].toChars(), sc._module.toChars());
sym.errors = true;
}
ad.dsymbolSemantic(sc);
// If the import declaration is in non-root module,
// analysis of the aliased symbol is deferred.

View file

@ -14,5 +14,6 @@ int func()
{
thebar +=1;
packagebar += 1;
thebar +=1;
return 0;
}