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

Implicit derivation failing when using cached implicits + orphan derivation at the same time #391

Closed
alexarchambault opened this issue May 21, 2015 · 4 comments
Assignees
Labels

Comments

@alexarchambault
Copy link
Collaborator

See the last two commits here: https://github.com/alexarchambault/argonaut-shapeless/commits/test/orphans and here: https://github.com/alexarchambault/scalacheck-shapeless/commits/test/orphans.

Cached implicits were enabled. The first of the two commits enables orphan derivation by default, which breaks implicit derivation. The last of the two commits disables cached implicits, which makes things work again.

I'm afraid I can't derive a minimalist example right now... The code bases of argonaut-shapeless and scalacheck-shapeless aren't that large though.

@milessabin
Copy link
Owner

It'd be really helpful if you could find some time to post a minimization. I'll punt this until the next release for now.

@milessabin milessabin added the Bug label May 21, 2015
@milessabin milessabin added this to the shapeless-2.3.0 milestone May 21, 2015
@alexarchambault
Copy link
Collaborator Author

I finally set up a minimal example here: https://github.com/alexarchambault/shapeless-cached-implicits-vs-orphan-derivation

It seems that implicit derivation through the fails with orphan derivers. (And cachedImplicit is using the internally.)

But it doesn't seem to happen all the time, and I wasn't able to reproduce it with more minimal type classes. That's why the example uses argonaut.

@milessabin
Copy link
Owner

Thanks for that ...

@milessabin
Copy link
Owner

This doesn't solve the problem for the in general, but it does solve the problem for cachedImplicit by replacing the with implicitly in its expansion.

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

No branches or pull requests

2 participants