File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ sealed trait Tuple extends Product:
34
34
/** Return a new tuple by concatenating `this` tuple with `that` tuple.
35
35
* This operation is O(this.size + that.size)
36
36
*/
37
+ // Contrarily to `this`, `that` does not need a type parameter
38
+ // since `++` is covariant in its second argument.
37
39
inline def ++ [This >: this .type <: Tuple ](that : Tuple ): This ++ that.type =
38
40
runtime.Tuples .concat(this , that).asInstanceOf [Concat [This , that.type ]]
39
41
@@ -165,6 +167,7 @@ object Tuple:
165
167
infix type :* [X <: Tuple , Y ] = Append [X , Y ]
166
168
167
169
/** Type of the concatenation of two tuples `X` and `Y` */
170
+ // Can be covariant in `Y` since it never appears as a match type scrutinee.
168
171
type Concat [X <: Tuple , + Y <: Tuple ] <: Tuple = X match
169
172
case EmptyTuple => Y
170
173
case x *: xs => x *: Concat [xs, Y ]
You can’t perform that action at this time.
0 commit comments