Skip to content

Commit a8344d3

Browse files
committed
Avoid spurious "double-def" error message involving erroneous definition
1 parent 59fc40a commit a8344d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/typer/Checking.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,9 @@ trait Checking {
624624
for (other <- seen(decl.name)) {
625625
typr.println(i"conflict? $decl $other")
626626
if (decl.matches(other)) {
627-
def doubleDefError(decl: Symbol, other: Symbol): Unit = {
628-
ctx.error(DoubleDeclaration(decl, other), decl.pos)
629-
}
627+
def doubleDefError(decl: Symbol, other: Symbol): Unit =
628+
if (!decl.info.isErroneous && !other.info.isErroneous)
629+
ctx.error(DoubleDeclaration(decl, other), decl.pos)
630630
if (decl is Synthetic) doubleDefError(other, decl)
631631
else doubleDefError(decl, other)
632632
}

0 commit comments

Comments
 (0)