Skip to content

Commit 70ca930

Browse files
committed
fix #1701: disqualify package name in type name resolution
1 parent adb37ee commit 70ca930

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
126126
* case x :: xs in class List would return the :: method).
127127
*/
128128
def qualifies(denot: Denotation): Boolean =
129-
reallyExists(denot) && !(
130-
pt.isInstanceOf[UnapplySelectionProto] &&
131-
(denot.symbol is (Method, butNot = Accessor)))
129+
reallyExists(denot) &&
130+
!(name.isTypeName && denot.symbol.is(Package)) &&
131+
!(pt.isInstanceOf[UnapplySelectionProto] &&
132+
(denot.symbol is (Method, butNot = Accessor)))
132133

133134
/** Find the denotation of enclosing `name` in given context `ctx`.
134135
* @param previous A denotation that was found in a more deeply nested scope,

0 commit comments

Comments
 (0)