Skip to content

Commit c76800d

Browse files
authored
Merge pull request #10019 from dotty-staging/fix-8344
fix #8344: add regression tests
2 parents 98f81ef + ff66369 commit c76800d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/pos/i8344-1.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import scala.{Tuple => STuple}
2+
3+
enum Datatype[T] {
4+
case Tuple[T <: STuple](elems: STuple.Map[T, Datatype]) extends Datatype[T]
5+
}
6+
7+
object Datatype {
8+
given [H, T <: STuple](using ht: Datatype[H], tt: Datatype[T]) as Datatype[H *: T] = tt match {
9+
case Datatype.Tuple(elems) => Datatype.Tuple(ht *: elems)
10+
}
11+
}

tests/pos/i8344-2.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
sealed trait Datatype[T]
2+
case class Foo[T <: Tuple](elems: Tuple.Map[T, Datatype]) extends Datatype[T]
3+
4+
def g =
5+
val tt: Datatype[_] = ???
6+
tt match {
7+
case Foo(_) => ???
8+
}

0 commit comments

Comments
 (0)