Skip to content

Commit

Permalink
Check parents non-empty before calling reduceLeft
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Sep 30, 2024
1 parent 9961e70 commit 8f4210e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,9 @@ trait Applications extends Compatibility {

def widenPrefix(alt: TermRef): Type = alt.prefix.widen match
case pre: (TypeRef | ThisType) if pre.typeSymbol.is(Module) =>
pre.parents.reduceLeft(TypeComparer.andType(_, _))
val ps = pre.parents
if ps.isEmpty then pre
else ps.reduceLeft(TypeComparer.andType(_, _))
case wpre => wpre

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

0 comments on commit 8f4210e

Please sign in to comment.