diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index db1bf85ade93..670ce4961ee5 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -1030,7 +1030,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling tp1.cases.corresponds(tp2.cases)(isSubType) case _ => false } - (!caseLambda.exists || canWidenAbstract) && recur(tp1.underlying, tp2) || compareMatch + recur(tp1.underlying, tp2) || compareMatch case tp1: AnnotatedType if tp1.isRefining => isNewSubType(tp1.parent) case JavaArrayType(elem1) => diff --git a/compiler/test/dotc/pos-test-pickling.blacklist b/compiler/test/dotc/pos-test-pickling.blacklist index f1e6ce805b27..09b3ec010034 100644 --- a/compiler/test/dotc/pos-test-pickling.blacklist +++ b/compiler/test/dotc/pos-test-pickling.blacklist @@ -53,6 +53,7 @@ i15827.scala i17149.scala tuple-fold.scala mt-redux-norm.perspective.scala +i18202.scala # Opaque type i5720.scala diff --git a/tests/pos/i18202.scala b/tests/pos/i18202.scala new file mode 100644 index 000000000000..345888f88921 --- /dev/null +++ b/tests/pos/i18202.scala @@ -0,0 +1,7 @@ +import compiletime.ops.int.* + +type TupleIndex[T <: Tuple, A, I <: Int] <: (Any, Int) = T match + case A *: _ => (A, I) + case _ *: t => TupleIndex[t, A, S[I]] + +def tupleIndex[T <: Tuple, A](using i: ValueOf[Tuple.Elem[TupleIndex[T, A, 0], 1]]): Int = i.value