aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala8
1 files changed, 4 insertions, 4 deletions
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
}