Skip to content

Tuples created through *: do not have a Mirror.Of[T] #14127

Closed
@juanjovazquez

Description

@juanjovazquez

Compiler version

3.1.1-RC1
3.1.0

Minimized code

summon[Mirror.Of[Int *: String *: Boolean *: EmptyTuple]]

Output

no implicit argument of type deriving.Mirror.Of[Int *: String *: Boolean *: EmptyTuple] was found for parameter x of method summon in object Predef

Expectation

Output should be the same as:

summon[Mirror.Of[(Int, String, Boolean)]]

since

summon[(Int, String, Boolean) =:= (Int *: String *: Boolean *: EmptyTuple)]

The cause seems related to the fact that *: is an abstract class and those are excluded from being generic products. Relevant links:
https://github.com/lampepfl/dotty/blob/7a473349b3fb64e7c6c9dfcfb02758f4a2e3756c/library/src/scala/Tuple.scala#L318

https://github.com/lampepfl/dotty/blob/7a473349b3fb64e7c6c9dfcfb02758f4a2e3756c/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala#L233

https://github.com/lampepfl/dotty/blob/master/compiler/src/dotty/tools/dotc/transform/SymUtils.scala#L77-L88

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions