Skip to content

Commit 8f4210e

Browse files
committed
Check parents non-empty before calling reduceLeft
1 parent 9961e70 commit 8f4210e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,9 @@ trait Applications extends Compatibility {
19621962

19631963
def widenPrefix(alt: TermRef): Type = alt.prefix.widen match
19641964
case pre: (TypeRef | ThisType) if pre.typeSymbol.is(Module) =>
1965-
pre.parents.reduceLeft(TypeComparer.andType(_, _))
1965+
val ps = pre.parents
1966+
if ps.isEmpty then pre
1967+
else ps.reduceLeft(TypeComparer.andType(_, _))
19661968
case wpre => wpre
19671969

19681970
/** If two alternatives have the same symbol, we pick the one with the most

0 commit comments

Comments
 (0)