diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-11-16 23:23:26 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-11-17 10:06:51 +0100 |
commit | 040379e2d5a77722563d73723044e065f2c1632b (patch) | |
tree | 0380dd1a96cce534b865e1de08bcc063bb15b8db /src/dotty/tools/dotc/typer/Namer.scala | |
parent | e73397ff48a518ffa5c7b381d04e210f401ab4f9 (diff) | |
download | dotty-040379e2d5a77722563d73723044e065f2c1632b.tar.gz dotty-040379e2d5a77722563d73723044e065f2c1632b.tar.bz2 dotty-040379e2d5a77722563d73723044e065f2c1632b.zip |
Annotate error in test not revealed before prev commit
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 8 |
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 } |