Skip to content

summon Mirror of a union type has incorrect children #13493

Closed
@bishabosha

Description

@bishabosha

If I summon a Mirror for Option[Int] | Option[String] then the children in MirroredElemTypes are None.type and Some[Int]

Compiler version

3.0.2

Minimized code

summon[deriving.Mirror.Of[Option[Int] | Option[String]]]

Output

scala> summon[deriving.Mirror.Of[Option[Int] | Option[String]]]                                                         
val res0: 
  (
    deriving.Mirror{
      MirroredType = (Option[Int] | Option[String]); 
        MirroredMonoType = (Option[Int] | Option[String])
      ; MirroredElemTypes <: Tuple
    }
   & 
    scala.deriving.Mirror.Sum{
      MirroredMonoType = (Option[Int] | Option[String]); 
        MirroredType = (Option[Int] | Option[String])
      ; MirroredLabel = "Option"
    }
  ){
    MirroredElemTypes = (None.type, Some[Int]); 
      MirroredElemLabels = ("None$", "Some")
  } = anon$1@36618b3b

Expectation

I would expect that this should be illegal, or at least the mirrored elem types should mention String somewhere

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions