From 040379e2d5a77722563d73723044e065f2c1632b Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 16 Nov 2016 23:23:26 +0100 Subject: Annotate error in test not revealed before prev commit --- src/dotty/tools/dotc/typer/Namer.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Namer.scala') diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 51d7605c9..78f0da1f0 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -348,10 +348,10 @@ class Namer { typer: Typer => if ((existing is Package) && (pkgOwner eq existing.owner)) existing else { /** If there's already an existing type, then the package is a dup of this type */ - val existingTpe = pkgOwner.info.decls.lookup(pid.name.toTypeName) - if (existingTpe != NoSymbol) { - ctx.error(PkgDuplicateSymbol(existingTpe), pid.pos) - ctx.newCompletePackageSymbol(pkgOwner, (pid.name ++ "$termDup").toTermName).entered + val existingType = pkgOwner.info.decls.lookup(pid.name.toTypeName) + if (existingType.exists) { + ctx.error(PkgDuplicateSymbol(existingType), pid.pos) + ctx.newCompletePackageSymbol(pkgOwner, (pid.name ++ "$_error_").toTermName).entered } else ctx.newCompletePackageSymbol(pkgOwner, pid.name.asTermName).entered } -- cgit v1.2.3