diff options
author | liu fengyun <liu@fengy.me> | 2016-11-16 17:59:58 +0100 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2016-11-16 17:59:58 +0100 |
commit | 70ca930da70b7d62e7a7913657a0b5e7cbd8f143 (patch) | |
tree | 7c92139d6a8baf4d9d03e1c80488aa9a2897280c | |
parent | adb37eee8974be841ff5eef2655c23394c05badb (diff) | |
download | dotty-70ca930da70b7d62e7a7913657a0b5e7cbd8f143.tar.gz dotty-70ca930da70b7d62e7a7913657a0b5e7cbd8f143.tar.bz2 dotty-70ca930da70b7d62e7a7913657a0b5e7cbd8f143.zip |
fix #1701: disqualify package name in type name resolution
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index a93262314..32d4a8336 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -126,9 +126,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit * case x :: xs in class List would return the :: method). */ def qualifies(denot: Denotation): Boolean = - reallyExists(denot) && !( - pt.isInstanceOf[UnapplySelectionProto] && - (denot.symbol is (Method, butNot = Accessor))) + reallyExists(denot) && + !(name.isTypeName && denot.symbol.is(Package)) && + !(pt.isInstanceOf[UnapplySelectionProto] && + (denot.symbol is (Method, butNot = Accessor))) /** Find the denotation of enclosing `name` in given context `ctx`. * @param previous A denotation that was found in a more deeply nested scope, |