Skip to content

Commit 66b8a7d

Browse files
Add test case
1 parent 0f0137e commit 66b8a7d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/pos/9871.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
object Test {
2+
type IsTypeInTuple[T, Tup <: Tuple] = Tup match {
3+
case EmptyTuple => false
4+
case T *: ts => true
5+
case _ *: ts => IsTypeInTuple[T, ts]
6+
}
7+
summon[(Int *: String *: EmptyTuple) =:= (Int, String)] //they are the same
8+
summon[IsTypeInTuple[String, Int *: String *: EmptyTuple] =:= true] //compiles
9+
summon[IsTypeInTuple[String, (Int, String)] =:= true] //doesn't compile
10+
summon[IsTypeInTuple[String, compiletime.Widen[Int *: String *: EmptyTuple]] =:= true] // doesn't compiles
11+
}

0 commit comments

Comments
 (0)