Skip to content

Commit 2d7ee66

Browse files
committed
Fix #8933: Fix eta expansion when comparing hk types
1 parent b4338a8 commit 2d7ee66

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
497497
if (base.typeSymbol == cls2) return true
498498
}
499499
else if tp1.isLambdaSub && !tp1.isAnyKind then
500-
return recur(tp1, EtaExpansion(cls2.typeRef))
500+
return recur(tp1, EtaExpansion(tp2))
501501
fourthTry
502502
}
503503

tests/pos/i8933.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
trait Foo[F[_]]
2+
3+
trait Top {
4+
type F[X]
5+
def foo: Foo[F]
6+
}
7+
8+
trait Left extends Top
9+
10+
trait Right extends Top {
11+
trait F[X]
12+
def foo: Foo[F] = new Foo[F] {}
13+
}
14+
15+
class Bottom extends Left with Right

0 commit comments

Comments
 (0)