Skip to content

Commit f70ca09

Browse files
committed
Fix crash when comparing HKTypeLambda and RefinedType
Calling HKTypeLambda#member will crash when trying to form a NamedType, this happened in `compareRefinedSlow` so we now skip it. If this HKTypeLambda is an eta-expansion it will be handled by `fourthTry`. Somehow, this only started happening after the last commit, when running: > vulpix tests/neg But it's not deterministic, multiple runs may be necessary. The crash happened while compiling i1650.scala, but compiling this file by itself didn't trigger the failure.
1 parent b90a468 commit f70ca09

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
413413
// of an `AndType` can lead to a cascade of subtyping checks
414414
// This twist is needed to make collection/generic/ParFactory.scala compile
415415
fourthTry(tp1, tp2) || compareRefinedSlow
416+
case tp1: HKTypeLambda =>
417+
// HKTypeLambdas do not have members.
418+
fourthTry(tp1, tp2)
416419
case _ =>
417420
compareRefinedSlow || fourthTry(tp1, tp2)
418421
}

0 commit comments

Comments
 (0)