-
Notifications
You must be signed in to change notification settings - Fork 1.1k
given instance is declared as erased, but is in fact used #13044
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
Comments
FWIW, the example compiles for me on both 3.0.0 and 3.0.1 with |
Oh, I was not aware of this setting, I confirm it solves my initial problem 👍 |
Is this a new option? The same code that compiled without it on Scala 3.0.0 now requires increasing this value on Scala 3.0.1: typelevel/kittens#376 Also a bit annoying for |
Coming in 3.1.0: #13267 |
It seems we are missing not inlining one of the calls to |
I had this error come up in a new place when I upgraded from 3.0.2 to 3.1.0 (similar derivation for very nested and recursive code). Increasing |
@ghostdogpr if |
@nicolasstucki I have a hard time reproducing it in an isolated minimized way. Is it okay if I provide an entire repo? |
Yes, we will mark it as |
Opened #13785 👍 |
We've hit this problem in tapir (softwaremill/tapir#1731), and minimized a bit in magnolia (softwaremill/magnolia#374). While bumping the max-inline does solve the problem, I think it's not really resolved - we either have to come up with a better solution in magnolia (suggestions welcome :) - one idea we have is to replace depending on The case classes involved aren't that complicated, so I suspect this might surface once and again when using typeclass derivation (esp using Magnolia) in real-world scenarios, which get much more complex. Finally, the error is quite misleading. Maybe it would make sense to open another issue to make this more actionable (sth like "Max-inline limit reach. Increase using max-inlines to continue"? Would that be technically possible to detect? |
Compiler version
3.0.1
Minimized code
Output
Expectation
I got this error while upgrading caliban from 3.0.0 to 3.0.1 on some code that was previously compiling. It seems that it fails to derive a typeclass instance in the presence of recursion and nesting. If I reduce the nesting, it works. I managed to reproduce it with the smaller example above, but this code fails with 3.0.0 with a different error. Any idea what's going on?
The text was updated successfully, but these errors were encountered: