diff --git a/compiler/test/dotc/pos-test-pickling.blacklist b/compiler/test/dotc/pos-test-pickling.blacklist index b42d41f0df85..a39a30f66164 100644 --- a/compiler/test/dotc/pos-test-pickling.blacklist +++ b/compiler/test/dotc/pos-test-pickling.blacklist @@ -40,6 +40,7 @@ i9999.scala 9890.scala 13491.scala 7512.scala +i6505.scala # Opaque type i5720.scala diff --git a/tests/pos/i6505.scala b/tests/pos/i6505.scala new file mode 100644 index 000000000000..774d5143f008 --- /dev/null +++ b/tests/pos/i6505.scala @@ -0,0 +1,45 @@ +class Foo { + + type E[X] + + def i: Int = ??? + def e: E[Int] = ??? + + // Transforms `(T1, ... Tn)` into `(E[T1], ..., E[Tn])` + type F[T <: Tuple] <: Tuple = T match { + case EmptyTuple => EmptyTuple + case h *: t => E[h] *: F[t] + } + + def foo1[Args <: Tuple](args: Args, args2: F[Args]): Unit = () + + foo1((i, i), (e, e)) // fails + foo1((i, i), (e, e): F[(Int, Int)]) // fails + +} + +class Foo2 { + + type E[X] + + def i: Int = ??? + def e: E[Int] = ??? + + // Transforms `(T1, ... Tn)` into `(E[T1], ..., E[Tn])` + type F[T <: Tuple] <: Tuple = T match { + case EmptyTuple => EmptyTuple + case h *: t => E[h] *: F[t] + } + + def foo2[Args <: Tuple, Args2 >: F[Args] <: F[Args]](args: Args, args2: Args2): Unit = () + + foo2((i, i), (e, e)) // fails + + // all these work + foo2[(Int, Int), F[(Int, Int)]]((i, i), (e, e)) + foo2[(Int, Int), F[(Int, Int)]]((i, i), (e, e)) + foo2[(Int, Int), F[Int *: Int *: EmptyTuple]]((i, i), (e, e)) + foo2[(Int, Int), (E[Int], E[Int])]((i, i), (e, e)) + foo2[(Int, Int), E[Int] *: E[Int] *: EmptyTuple]((i, i), (e, e)) + +} \ No newline at end of file