-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
minimized code
scala> type I[A <: Tuple] <: Tuple = A match {
| case Unit => Unit
| case hd *: tl => hd *: I[tl]
| }
scala> (1, 2): I[(Int, Int)]
val res4: (Int, Int) = (1,2)
scala> type DU[A <: Tuple] <: Tuple = A match {
| case Unit => Unit
| case Unit *: tl => DU[tl]
| case hd *: tl => hd *: DU[tl]
| }
scala> (1, 2): DU[(Int, Int)]
1 |(1, 2): DU[(Int, Int)]
|^^^^^^
|Found: (Int, Int)
|Required: DU[(Int, Int)]
expectation
DU[(Int, Int)]
should expand to (Int, Int)
but doesn't. Only difference between DU
and I
(which works), is the Unit *: tl
case.