Skip to content

Commit a60a953

Browse files
committed
Add EmptyTuple type alias
1 parent e534d92 commit a60a953

16 files changed

+55
-52
lines changed

library/src-bootstrapped/scala/Tuple.scala

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ sealed trait Tuple extends Any {
3535
* `((a1, b1), ..., (an, bn))`. If the two tuples have different sizes,
3636
* the extra elements of the larger tuple will be disregarded.
3737
* The result is typed as `((A1, B1), ..., (An, Bn))` if at least one of the
38-
* tuple types has a `Unit` tail. Otherwise the result type is
38+
* tuple types has a `EmptyTuple` tail. Otherwise the result type is
3939
* `(A1, B1) *: ... *: (Ai, Bi) *: Tuple`
4040
*/
4141
inline def zip[This >: this.type <: Tuple, T2 <: Tuple](t2: T2): Zip[This, T2] =
@@ -84,7 +84,7 @@ object Tuple {
8484

8585
/** Type of the concatenation of two tuples */
8686
type Concat[X <: Tuple, +Y <: Tuple] <: Tuple = X match {
87-
case Unit => Y
87+
case EmptyTuple => Y
8888
case x1 *: xs1 => x1 *: Concat[xs1, Y]
8989
}
9090

@@ -99,32 +99,32 @@ object Tuple {
9999

100100
/** Literal constant Int size of a tuple */
101101
type Size[X <: Tuple] <: Int = X match {
102-
case Unit => 0
102+
case EmptyTuple => 0
103103
case x *: xs => S[Size[xs]]
104104
}
105105

106106
/** Converts a tuple `(T1, ..., Tn)` to `(F[T1], ..., F[Tn])` */
107107
type Map[Tup <: Tuple, F[_]] <: Tuple = Tup match {
108-
case Unit => Unit
108+
case EmptyTuple => EmptyTuple
109109
case h *: t => F[h] *: Map[t, F]
110110
}
111111

112112
/** Given two tuples, `A1 *: ... *: An * At` and `B1 *: ... *: Bn *: Bt`
113-
* where at least one of `At` or `Bt` is `Unit` or `Tuple`,
113+
* where at least one of `At` or `Bt` is `EmptyTuple` or `Tuple`,
114114
* returns the tuple type `(A1, B1) *: ... *: (An, Bn) *: Ct`
115-
* where `Ct` is `Unit` if `At` or `Bt` is `Unit`, otherwise `Ct` is `Tuple`.
115+
* where `Ct` is `EmptyTuple` if `At` or `Bt` is `EmptyTuple`, otherwise `Ct` is `Tuple`.
116116
*/
117117
type Zip[T1 <: Tuple, T2 <: Tuple] <: Tuple = (T1, T2) match {
118118
case (h1 *: t1, h2 *: t2) => (h1, h2) *: Zip[t1, t2]
119-
case (Unit, _) => Unit
120-
case (_, Unit) => Unit
119+
case (EmptyTuple, _) => EmptyTuple
120+
case (_, EmptyTuple) => EmptyTuple
121121
case _ => Tuple
122122
}
123123

124124
/** Converts a tuple `(F[T1], ..., F[Tn])` to `(T1, ... Tn)` */
125125
type InverseMap[X <: Tuple, F[_]] <: Tuple = X match {
126126
case F[x] *: t => x *: InverseMap[t, F]
127-
case Unit => Unit
127+
case EmptyTuple => EmptyTuple
128128
}
129129

130130
/** Implicit evidence. IsMappedBy[F][X] is present in the implicit scope iff
@@ -136,9 +136,9 @@ object Tuple {
136136

137137
/** Transforms a tuple `(T1, ..., Tn)` into `(T1, ..., Ti)`. */
138138
type Take[T <: Tuple, N <: Int] <: Tuple = N match {
139-
case 0 => Unit
139+
case 0 => EmptyTuple
140140
case S[n1] => T match {
141-
case Unit => Unit
141+
case EmptyTuple => EmptyTuple
142142
case x *: xs => x *: Take[xs, n1]
143143
}
144144
}
@@ -147,7 +147,7 @@ object Tuple {
147147
type Drop[T <: Tuple, N <: Int] <: Tuple = N match {
148148
case 0 => T
149149
case S[n1] => T match {
150-
case Unit => Unit
150+
case EmptyTuple => EmptyTuple
151151
case x *: xs => Drop[xs, n1]
152152
}
153153
}
@@ -158,10 +158,10 @@ object Tuple {
158158
type Split[T <: Tuple, N <: Int] = (Take[T, N], Drop[T, N])
159159

160160
/** Empty tuple */
161-
def apply(): Unit = ()
161+
def apply(): EmptyTuple = ()
162162

163163
/** Matches an empty tuple. */
164-
def unapply(x: Any): Boolean = x.isInstanceOf[Unit]
164+
def unapply(x: Any): Boolean = x.isInstanceOf[EmptyTuple]
165165

166166
/** Convert an array into a tuple of unknown arity and types */
167167
def fromArray[T](xs: Array[T]): Tuple = {
@@ -191,6 +191,9 @@ object Tuple {
191191
Tuple.fromArray(p.productIterator.toArray).asInstanceOf[m.MirroredElemTypes] // TODO use toIArray of Object to avoid double/triple array copy
192192
}
193193

194+
/** Tuple of arity 0 */
195+
type EmptyTuple = Unit
196+
194197
/** Tuple of arbitrary non-zero arity */
195198
sealed trait NonEmptyTuple extends Tuple with Product {
196199
import Tuple._

tests/neg-custom-args/typeclass-derivation2.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ object Either {
185185
import TypeLevel._
186186

187187
type Shape[L, R] = Shape.Cases[(
188-
Shape.Case[Left[L], L *: Unit],
189-
Shape.Case[Right[R], R *: Unit]
188+
Shape.Case[Left[L], L *: EmptyTuple],
189+
Shape.Case[Right[R], R *: EmptyTuple]
190190
)]
191191

192192
val genericClass = new GenericClass("Left\000x\001Right\000x")

tests/pos-custom-args/matchtype.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ object Test {
5959
erased val z5: (String, Int) = erasedValue[Concat[Unit, (String, Int)]]
6060
erased val y6: Concat[(Boolean, Boolean), (String, Int)] = erasedValue[Boolean *: Boolean *: (String, Int)]
6161
erased val z6: Boolean *: Boolean *: (String, Int) = erasedValue[Concat[(Boolean, Boolean), (String, Int)]]
62-
erased val y7: (Boolean, Boolean, String, Int) = erasedValue[Concat[(Boolean, Boolean), String *: Int *: Unit]]
63-
erased val z7: Concat[(Boolean, Boolean), String *: Int *: Unit] = erasedValue[(Boolean, Boolean, String, Int)]
62+
erased val y7: (Boolean, Boolean, String, Int) = erasedValue[Concat[(Boolean, Boolean), String *: Int *: EmptyTuple]]
63+
erased val z7: Concat[(Boolean, Boolean), String *: Int *: EmptyTuple] = erasedValue[(Boolean, Boolean, String, Int)]
6464

6565
def index[Xs <: NonEmptyTuple](xs: Xs, n: Int): Elem[Xs, n.type] = xs(n).asInstanceOf
6666

tests/pos/8313.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ object Test {
55
case hd *: tl => hd *: DU[tl]
66
}
77

8-
(1, 2): DU[Int *: Int *: Unit]
8+
(1, 2): DU[Int *: Int *: EmptyTuple]
99
}

tests/pos/automatic-tupling-of-function-parameters.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object Test {
55
val g2: Tuple2[Int, String] => Int = _ + _.length
66

77
// FIXME issue #5257
8-
// val h2: Int *: Int *: Unit => Int = (x, y) => x + y
8+
// val h2: Int *: Int *: EmptyTuple => Int = (x, y) => x + y
99
// val k2: Int *: Tuple1[Int] => Int = (x, y) => x + y
1010

1111
type T2 = Tuple2[Int, Int]

tests/pos/i7262.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import scala.quoted._
22
class Foo {
33
def f[T](t: Type[T])(using QuoteContext) = t match {
4-
case '[ Int *: Unit ] =>
4+
case '[ Int *: EmptyTuple ] =>
55
}
66
}

tests/pos/scala-days-2019-slides/metaprogramming-2-tuple.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ object TupleExample {
55
type B
66
type C
77

8-
summon[Concat[A *: B *: Unit, C *: Unit] =:= A *: B *: C *: Unit]
8+
summon[Concat[A *: B *: EmptyTuple, C *: EmptyTuple] =:= A *: B *: C *: EmptyTuple]
99

10-
summon[Concat[A *: B *: Unit, C *: Tuple] =:= A *: B *: C *: Tuple]
10+
summon[Concat[A *: B *: EmptyTuple, C *: Tuple] =:= A *: B *: C *: Tuple]
1111

12-
summon[Concat[A *: B *: Tuple, C *: Unit] <:< A *: B *: Tuple]
12+
summon[Concat[A *: B *: Tuple, C *: EmptyTuple] <:< A *: B *: Tuple]
1313
}

tests/run-custom-args/tuple-cons.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import dotty._
22

33
object Test {
44
def main(args: Array[String]) = {
5-
val t1: *:[Int, *:[Int, Unit]] = (1, 2)
5+
val t1: *:[Int, *:[Int, EmptyTuple]] = (1, 2)
66

7-
val t2: *:[Int, *:[Int, *:[Int, Unit]]] = 0 *: t1
7+
val t2: *:[Int, *:[Int, *:[Int, EmptyTuple]]] = 0 *: t1
88

99
assert(t2.head == 0)
1010
assert(t2.tail.head == 1)
@@ -17,7 +17,7 @@ object Test {
1717
assert(e3 == 2)
1818
}
1919

20-
val t3: *:[Int, *:[Int, *:[Int, *:[Int, Unit]]]] = -1 *: t2
20+
val t3: *:[Int, *:[Int, *:[Int, *:[Int, EmptyTuple]]]] = -1 *: t2
2121

2222
assert(t3.head == -1)
2323
assert(t3.tail.head == 0)
@@ -35,7 +35,7 @@ object Test {
3535
type I = Int
3636

3737
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
38-
val t20: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,Unit]]]]]]]]]]]]]]]]]]]] = 1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: 10 *: 11 *: 12 *: 13 *: 14 *: 15 *: 16 *: 17 *: 18 *: 19 *: 20 *: Tuple()
38+
val t20: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,EmptyTuple]]]]]]]]]]]]]]]]]]]] = 1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: 10 *: 11 *: 12 *: 13 *: 14 *: 15 *: 16 *: 17 *: 18 *: 19 *: 20 *: Tuple()
3939

4040
t20 match {
4141
case e1 *: e2 *: e3 *: e4 *: e5 *: e6 *: e7 *: e8 *: e9 *: e10 *: e11 *: e12 *: e13 *: e14 *: e15 *: e16 *: e17 *: e18 *: e19 *: e20 *: Tuple() =>
@@ -62,7 +62,7 @@ object Test {
6262
}
6363

6464
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
65-
val t21: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,Unit]]]]]]]]]]]]]]]]]]]]] = 21 *: t20
65+
val t21: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,EmptyTuple]]]]]]]]]]]]]]]]]]]]] = 21 *: t20
6666

6767
t21 match {
6868
case e21 *: e1 *: e2 *: e3 *: e4 *: e5 *: e6 *: e7 *: e8 *: e9 *: e10 *: e11 *: e12 *: e13 *: e14 *: e15 *: e16 *: e17 *: e18 *: e19 *: e20 *: Tuple() =>
@@ -90,7 +90,7 @@ object Test {
9090
}
9191

9292
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
93-
val t22: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,Unit]]]]]]]]]]]]]]]]]]]]]] = 22 *: t21
93+
val t22: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,EmptyTuple]]]]]]]]]]]]]]]]]]]]]] = 22 *: t21
9494

9595
t22 match {
9696
case e22 *: e21 *: e1 *: e2 *: e3 *: e4 *: e5 *: e6 *: e7 *: e8 *: e9 *: e10 *: e11 *: e12 *: e13 *: e14 *: e15 *: e16 *: e17 *: e18 *: e19 *: e20 *: Tuple() =>
@@ -119,7 +119,7 @@ object Test {
119119
}
120120

121121
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
122-
val t23: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,Unit]]]]]]]]]]]]]]]]]]]]]]] = 23 *: t22
122+
val t23: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,EmptyTuple]]]]]]]]]]]]]]]]]]]]]]] = 23 *: t22
123123

124124
t23 match {
125125
case e23 *: e22 *: e21 *: e1 *: e2 *: e3 *: e4 *: e5 *: e6 *: e7 *: e8 *: e9 *: e10 *: e11 *: e12 *: e13 *: e14 *: e15 *: e16 *: e17 *: e18 *: e19 *: e20 *: Tuple() =>
@@ -149,7 +149,7 @@ object Test {
149149
}
150150

151151
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
152-
val t24: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,Unit]]]]]]]]]]]]]]]]]]]]]]]] = 24 *: t23
152+
val t24: *:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,*:[I,EmptyTuple]]]]]]]]]]]]]]]]]]]]]]]] = 24 *: t23
153153

154154
t24 match {
155155
case e24 *: e23 *: e22 *: e21 *: e1 *: e2 *: e3 *: e4 *: e5 *: e6 *: e7 *: e8 *: e9 *: e10 *: e11 *: e12 *: e13 *: e14 *: e15 *: e16 *: e17 *: e18 *: e19 *: e20 *: Tuple() =>

tests/run-custom-args/typeclass-derivation2.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ object Either {
194194
import TypeLevel._
195195

196196
type Shape[L, R] = Shape.Cases[(
197-
Shape.Case[Left[L], L *: Unit],
198-
Shape.Case[Right[R], R *: Unit]
197+
Shape.Case[Left[L], L *: EmptyTuple],
198+
Shape.Case[Right[R], R *: EmptyTuple]
199199
)]
200200

201201
val reflectedClass = new ReflectedClass("Left\000x\001Right\000x")

tests/run-custom-args/typeclass-derivation2c.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,18 @@ case class Right[R](elem: R) extends Either[Nothing, R]
172172
object Left extends Generic.Product[Left[_]] {
173173
def fromProduct(p: Product): Left[_] = Left(productElement[Any](p, 0))
174174
implicit def GenericLeft[L]: Generic.Product[Left[L]] {
175-
type ElemTypes = L *: Unit
175+
type ElemTypes = L *: EmptyTuple
176176
type CaseLabel = "Left"
177-
type ElemLabels = "x" *: Unit
177+
type ElemLabels = "x" *: EmptyTuple
178178
} = this.asInstanceOf
179179
}
180180

181181
object Right extends Generic.Product[Right[_]] {
182182
def fromProduct(p: Product): Right[_] = Right(productElement[Any](p, 0))
183183
implicit def GenericRight[R]: Generic.Product[Right[R]] {
184-
type ElemTypes = R *: Unit
184+
type ElemTypes = R *: EmptyTuple
185185
type CaseLabel = "Right"
186-
type ElemLabels = "x" *: Unit
186+
type ElemLabels = "x" *: EmptyTuple
187187
} = this.asInstanceOf
188188
}
189189

tests/run/i5257.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object Test {
22

33
def main(args: Array[String]): Unit = {
4-
val f: Int *: Int *: Unit => Int = (x, y) => x + y
4+
val f: Int *: Int *: EmptyTuple => Int = (x, y) => x + y
55
val g: Int *: Tuple1[Int] => Int = (x, y) => x + y
66

77
println(f((1, 2)))

tests/run/tuples1.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object Test extends App {
1515
val h7 = x7.head; val h7c: Int = h7; println(s"h7 = $h7")
1616
val h8 = x8.head; val h8c: String = h8; println(s"h8 = $h8")
1717
val t1 = x1.tail; val t1c: Unit = t1; println(s"t1 = $t1")
18-
val t2 = x2.tail; val t2c: Int *: Unit = t2; println(s"t2 = $t2")
18+
val t2 = x2.tail; val t2c: Int *: EmptyTuple = t2; println(s"t2 = $t2")
1919
val t7 = x7.tail; val t7c: (String, Int) = t7.tail.tail.tail.tail; println(s"t7 = $t7")
2020
val t8 = x8.tail; val t8c: Int = t8(6); println(s"t8 = $t8")
2121
val a1_0 = x1(0); val a1_0c: Int = a1_0; println(s"a1_0 = $a1_0")
@@ -25,8 +25,8 @@ object Test extends App {
2525
val a6_4 = x6(4); val a6_4c: String = a6_4; println(s"a6_4 = $a6_4")
2626
val a8_0 = x8(0); val a8_0c: String = a8_0; println(s"a8_0 = $a8_0")
2727
val c0_0 = x0 ++ x0; val c0_0c: Unit = c0_0; println(s"c0_0 = $c0_0")
28-
val c0_1 = x0 ++ x1; val c0_1c: Int *: Unit = c0_1; println(s"c0_1 = $c0_1")
29-
val c1_0 = x1 ++ x0; val c1_0c: Int *: Unit = c1_0; println(s"c1_0 = $c1_0")
28+
val c0_1 = x0 ++ x1; val c0_1c: Int *: EmptyTuple = c0_1; println(s"c0_1 = $c0_1")
29+
val c1_0 = x1 ++ x0; val c1_0c: Int *: EmptyTuple = c1_0; println(s"c1_0 = $c1_0")
3030
val c0_4 = x0 ++ x4; val c0_4c: (String, Int, String, Int) = c0_4; println(s"c0_4 = $c0_4")
3131
val c4_0 = x4 ++ x0; val c4_0c: (String, Int, String, Int) = c4_0; println(s"c4_0 = $c4_0")
3232
val c1_1 = x1 ++ x1; val c1_1c: (Int, Int) = c1_1; println(s"c1_1 = $c1_1")
@@ -42,7 +42,7 @@ object Test extends App {
4242
4343
{ val (x, xs) = decompose1
4444
val xc: String = x
45-
val xsc: Int *: Unit = xs
45+
val xsc: Int *: EmptyTuple = xs
4646
println(s"$x2 -> $x, $xs")
4747
}
4848

tests/run/tuples1a.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ object Test extends App {
44
val t7a = t7.tail
55
val t7b = t7a.tail
66
val t7c: Unit = (t7.tail: (Int, String)).tail
7-
val t7d: Unit = (t7.tail: Int *: String *: Unit).tail
7+
val t7d: Unit = (t7.tail: Int *: String *: EmptyTuple).tail
88
val t7e: Unit = t7.tail.tail
99
}

tests/run/typeclass-derivation2a.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ object Either {
190190
import genericClass.mirror
191191

192192
private type ShapeOf[L, R] = Shape.Cases[(
193-
Shape.Case[Left[L], L *: Unit],
194-
Shape.Case[Right[R], R *: Unit]
193+
Shape.Case[Left[L], L *: EmptyTuple],
194+
Shape.Case[Right[R], R *: EmptyTuple]
195195
)]
196196

197197
implicit def GenericEither[L, R]: Generic[Either[L, R]] { type Shape = ShapeOf[L, R] } =

tests/run/typeclass-derivation2b.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ object Either {
199199
import genericClass.mirror
200200
201201
private type ShapeOf[L, R] = Shape.Cases[(
202-
Shape.Case[Left[L], L *: Unit],
203-
Shape.Case[Right[R], R *: Unit]
202+
Shape.Case[Left[L], L *: EmptyTuple],
203+
Shape.Case[Right[R], R *: EmptyTuple]
204204
)]
205205
206206
implicit def GenericEither[L, R]: Generic[Either[L, R]] { type Shape = ShapeOf[L, R] } =

tests/run/typeclass-derivation2d.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ object Left extends Mirror.Product {
173173
def _fromProduct(p: Product): Left[_] = Left(productElement[Any](p, 0))
174174
implicit def mirror[L]: Mirror.Product {
175175
type _MonoType = Left[L]
176-
type ElemTypes = L *: Unit
176+
type ElemTypes = L *: EmptyTuple
177177
type CaseLabel = "Left"
178-
type ElemLabels = "x" *: Unit
178+
type ElemLabels = "x" *: EmptyTuple
179179
} = this.asInstanceOf
180180
}
181181

@@ -184,9 +184,9 @@ object Right extends Mirror.Product {
184184
def _fromProduct(p: Product): Right[_] = Right(productElement[Any](p, 0))
185185
implicit def mirror[R]: Mirror.Product {
186186
type _MonoType = Right[R]
187-
type ElemTypes = R *: Unit
187+
type ElemTypes = R *: EmptyTuple
188188
type CaseLabel = "Right"
189-
type ElemLabels = "x" *: Unit
189+
type ElemLabels = "x" *: EmptyTuple
190190
} = this.asInstanceOf
191191
}
192192

0 commit comments

Comments
 (0)