From 7c63974570ea19348365f475fccc9df41f0efa5e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 19 Mar 2018 17:53:03 +0100 Subject: [PATCH] Avoid spurious "double-def" error message involving erroneous definition --- compiler/src/dotty/tools/dotc/typer/Checking.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index bcfd3636fb82..0659b68666dd 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -624,9 +624,9 @@ trait Checking { for (other <- seen(decl.name)) { typr.println(i"conflict? $decl $other") if (decl.matches(other)) { - def doubleDefError(decl: Symbol, other: Symbol): Unit = { - ctx.error(DoubleDeclaration(decl, other), decl.pos) - } + def doubleDefError(decl: Symbol, other: Symbol): Unit = + if (!decl.info.isErroneous && !other.info.isErroneous) + ctx.error(DoubleDeclaration(decl, other), decl.pos) if (decl is Synthetic) doubleDefError(other, decl) else doubleDefError(decl, other) }