Skip to content
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

Ambiguous implicits for one empty enum case #51

Closed
sake92 opened this issue Dec 8, 2021 · 3 comments
Closed

Ambiguous implicits for one empty enum case #51

sake92 opened this issue Dec 8, 2021 · 3 comments

Comments

@sake92
Copy link

sake92 commented Dec 8, 2021

If you have exactly one case with no parameter list you get ambiguous implicits.
If there are 2 cases it works, or if you have empty parens:

enum Works1 derives Eq:
  case Red, Blue

enum Works2 derives Eq:
  case Red()

enum Nope derives Eq: // ambigous implicits
  case Red

Not sure if there's any workarounds, first time I'm using shapeless.
Amazing library btw! 😃

Repro:
https://scastie.scala-lang.org/edoI6AKPQIKjuFM6vzzsWg

@andrzejressel
Copy link

andrzejressel commented Feb 15, 2022

I was doing some tests and it seems Shapeless for some reason really does not like enums without type parameters:

@liewhite
Copy link

It can be workaround by typeclass lookup priority. Such as put product derives and coproduct derives in an object hierarchy

@joroKr21
Copy link
Member

Fixed upstream - thanks @andrzejressel 🥳 scala/scala3#14525

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

No branches or pull requests

4 participants