Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bishabosha opened this issue Oct 12, 2020 · 1 comment
Closed

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

bishabosha opened this issue Oct 12, 2020 · 1 comment

Comments

@bishabosha
Copy link
Member

bishabosha commented Oct 12, 2020

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

@odersky
Copy link
Contributor

odersky commented Dec 27, 2020

We discussed this and decided to leave things as they are

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants