From 70ca930da70b7d62e7a7913657a0b5e7cbd8f143 Mon Sep 17 00:00:00 2001 From: liu fengyun Date: Wed, 16 Nov 2016 17:59:58 +0100 Subject: fix #1701: disqualify package name in type name resolution --- src/dotty/tools/dotc/typer/Typer.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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, -- cgit v1.2.3