Skip to content

Commit 74153ea

Browse files
committed
Add a comment on Tuple.Head
1 parent 800aa0e commit 74153ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/src/scala/Tuple.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ object Tuple:
114114
case S[n1] => Elem[xs, n1]
115115

116116
/** The type of the first element of a tuple */
117+
// Only bounded by `<: Tuple` not `<: NonEmptyTuple`
118+
// even though it only matches non-empty tuples.
119+
// Avoids bounds check failures from an irreducible type
120+
// like `Tuple.Head[Tuple.Tail[X]]`
117121
type Head[X <: Tuple] = X match
118122
case x *: _ => x
119123

0 commit comments

Comments
 (0)