Skip to content

No Mirror.SumOf available for case with secondary parameter list #9985

Closed
@bishabosha

Description

@bishabosha

Minimized code

enum Foo:
  case Branch()(i: Int)

def m = summon[deriving.Mirror.SumOf[Foo]] 

Output

1 |def m = summon[deriving.Mirror.SumOf[Foo]]
  |                                          ^
  |no implicit argument of type deriving.Mirror.SumOf[Foo] was found for parameter x of method summon in object DottyPredef

Expectation

It seems limiting that Mirror is only defined for classes with state purely represented by their extractors. This also means there is no generic API for enum companions as summon[Mirror.SumOf[MyEnum]].ordinal(foo) is not always defined

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions