Skip to content

Commit aa98621

Browse files
authored
Merge pull request #9275 from dotty-staging/fix-liftToAnchors
Fix crash on implicit search involving higher-kinded types
2 parents 4379077 + 5cee25b commit aa98621

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,11 @@ trait ImplicitRunInfo:
675675
WildcardType
676676
else
677677
seen.addEntry(t)
678-
apply(
679-
t.underlying match
680-
case TypeBounds(lo, hi) =>
681-
if defn.isBottomTypeAfterErasure(lo) then hi
682-
else AndType.make(lo, hi)
683-
case u => u)
678+
t.underlying match
679+
case TypeBounds(lo, hi) =>
680+
if defn.isBottomTypeAfterErasure(lo) then apply(hi)
681+
else AndType.make(apply(lo), apply(hi))
682+
case u => apply(u)
684683

685684
def apply(t: Type) = t.dealias match
686685
case t: TypeRef =>

tests/pos/liftToAnchors-hk.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Foo[F[_], F2[X] >: F[X]] {
2+
def foo[A](using F[A] <:< F2[A]): Unit = {}
3+
foo
4+
}

0 commit comments

Comments
 (0)