diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 465978d329e6..6857e3da38ed 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -591,7 +591,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling val base = nonExprBaseType(tp1, cls2) if (base.typeSymbol == cls2) return true } - else if tp1.isLambdaSub && !tp1.isAnyKind then + else if tp1.typeParams.nonEmpty && !tp1.isAnyKind then return recur(tp1, EtaExpansion(tp2)) fourthTry } diff --git a/tests/pos/i16183/Lib_1.scala b/tests/pos/i16183/Lib_1.scala new file mode 100644 index 000000000000..824af18e1d40 --- /dev/null +++ b/tests/pos/i16183/Lib_1.scala @@ -0,0 +1,14 @@ +package pkg + +trait Foo1[A] +trait Foo2[A] extends Foo1[A] + +trait Bar[F[_]] +object Bar { + implicit val bar: Bar[pkg.Foo2] = ??? +} + +trait Qux +object Qux { + implicit def qux[F[_]](implicit bar: Bar[F]): F[Qux] = ??? +} \ No newline at end of file diff --git a/tests/pos/i16183/Test_2.scala b/tests/pos/i16183/Test_2.scala new file mode 100644 index 000000000000..c8c5cbed838c --- /dev/null +++ b/tests/pos/i16183/Test_2.scala @@ -0,0 +1,6 @@ +import pkg._ + +object Test { + implicitly[Foo2[Qux]] + implicitly[Foo1[Qux]] +} \ No newline at end of file