From 41c018d7ec1cfd2d1222df077e691f1b47ef0561 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 1 Nov 2023 13:57:09 +0100 Subject: [PATCH] =?UTF-8?q?Update=20wildcard=20types=C2=A0in=20Tuple=20mat?= =?UTF-8?q?ch=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/src/scala/Tuple.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/src/scala/Tuple.scala b/library/src/scala/Tuple.scala index 2d9aaea2be08..82ac991d71a2 100644 --- a/library/src/scala/Tuple.scala +++ b/library/src/scala/Tuple.scala @@ -97,25 +97,25 @@ object Tuple { /** Type of the head of a tuple */ type Head[X <: NonEmptyTuple] = X match { - case x *: _ => x + case x *: ? => x } /** Type of the initial part of the tuple without its last element */ type Init[X <: Tuple] <: Tuple = X match { - case _ *: EmptyTuple => EmptyTuple + case ? *: EmptyTuple => EmptyTuple case x *: xs => x *: Init[xs] } /** Type of the tail of a tuple */ type Tail[X <: NonEmptyTuple] <: Tuple = X match { - case _ *: xs => xs + case ? *: xs => xs } /** Type of the last element of a tuple */ type Last[X <: Tuple] = X match { case x *: EmptyTuple => x - case _ *: xs => Last[xs] + case ? *: xs => Last[xs] } /** Type of the concatenation of two tuples */ @@ -182,8 +182,8 @@ object Tuple { */ type Zip[T1 <: Tuple, T2 <: Tuple] <: Tuple = (T1, T2) match { case (h1 *: t1, h2 *: t2) => (h1, h2) *: Zip[t1, t2] - case (EmptyTuple, _) => EmptyTuple - case (_, EmptyTuple) => EmptyTuple + case (EmptyTuple, ?) => EmptyTuple + case (?, EmptyTuple) => EmptyTuple case _ => Tuple }