aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-03-09 18:55:24 +0100
committerMartin Odersky <odersky@gmail.com>2016-03-09 18:55:24 +0100
commit8c99865cecf41b844e0710620337d26838e647ef (patch)
tree09820e3e17922fea5e1a8c0ff0faf3a6c5a09b9a /src/dotty/tools/dotc/typer/Typer.scala
parentff8731041a522b73fde6bddd2d7077d19d35b6b0 (diff)
downloaddotty-8c99865cecf41b844e0710620337d26838e647ef.tar.gz
dotty-8c99865cecf41b844e0710620337d26838e647ef.tar.bz2
dotty-8c99865cecf41b844e0710620337d26838e647ef.zip
Fix bug where ambiguous references were not reported
There was a mssing condition which meant Tyepr thought it was at the outermost scope where but was mistaken. Fixes #1145
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 84344dbb1..fdb92a40b 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -232,7 +232,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
}
}
val curImport = ctx.importInfo
- if (curImport != null && curImport.isRootImport && previous.exists) return previous
+ if (ctx.owner.is(Package) && curImport != null && curImport.isRootImport && previous.exists)
+ return previous // no more conflicts possible in this case
// would import of kind `prec` be not shadowed by a nested higher-precedence definition?
def isPossibleImport(prec: Int) =
prevPrec < prec || prevPrec == prec && (prevCtx.scope eq ctx.scope)