Skip to content

Commit 877958e

Browse files
authored
Allow Tuple.Head and Tuple.Tail to work with EmptyTuple
1 parent cabfa68 commit 877958e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/src/scala/Tuple.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ object Tuple {
8989
}
9090

9191
/** Type of the head of a tuple */
92-
type Head[X <: NonEmptyTuple] = X match {
92+
type Head[X <: Tuple] = X match {
93+
case EmptyTuple => EmptyTuple
9394
case x *: _ => x
9495
}
9596

@@ -101,7 +102,8 @@ object Tuple {
101102
}
102103

103104
/** Type of the tail of a tuple */
104-
type Tail[X <: NonEmptyTuple] <: Tuple = X match {
105+
type Tail[X <: Tuple] <: Tuple = X match {
106+
case EmptyTuple => EmptyTuple
105107
case _ *: xs => xs
106108
}
107109

0 commit comments

Comments
 (0)