Skip to content

Mirror.Of is not implemented for named tuples #22382

Closed
@smarter

Description

@smarter

Compiler version

3.6.2

Minimized code

import scala.language.experimental.namedTuples
import scala.deriving.*

summon[Mirror.Of[(Int, String)]] // OK

summon[Mirror.Of[(foo: Int, bla: String)]] // error

Output

  |No given instance of type scala.deriving.Mirror.Of[(foo : Int, bar : String)] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type scala.deriving.Mirror.Of[(foo : Int, bar : String)]:
  |     * class Any is not a generic product because it is not a case class
  |     * class Any is not a generic sum because it is not a sealed class

Expectation

Just like regular tuples, named tuples should have mirror instances because they are product types and mirrors allow for uniform meta-programming on sums and products types.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions