[SOLVED] Dotty compile-time: how to compare a Tuple type with an instance of a tuple via summon

Say I have

    val tuple0: (String, String) = ("-1", "0")

I can do this:

    summon[ Tuple.Concat[(String, String), EmptyTuple] =:= (String, String)]

But how can I do something like:

    summon[ Tuple.Concat[(String, String), EmptyTuple] =:= tuple0.type ]

The above results in:

[error] 42 |    summon[ Tuple.Concat[(String, String), EmptyTuple] =:= tuple0.type ]
[error]    |                                                                        ^
[error]    |Cannot prove that String *: String *: 
[error]    |  scala.Tuple.Concat[scala.Tuple$package.EmptyTuple.type, EmptyTuple] =:= (tuple0 : (String, String)).
[error] one error found

TIA

I think you’d have to use tuple0.type <:< ... instead. Since they’re not exactly the same type.

Works, thanks.

I had tried:

    summon[ Tuple.Concat[(String, String), EmptyTuple] <:< tuple0.type ]

and got:

[error] 45 |    summon[ Tuple.Concat[(String, String), EmptyTuple] <:< tuple0.type ]
[error]    |                                                                        ^
[error]    |Cannot prove that String *: String *: 
[error]    |  scala.Tuple.Concat[scala.Tuple$package.EmptyTuple.type, EmptyTuple] <:< (tuple0 : (String, String)).
[error] one error found

Always forget this thing is not symmetrical. 8-(