-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Large case class crashes compiler with stackoverflow exception in Scala 3 #386
Comments
Yes, Scala 3.1.1 …
…On Tue, 19 Apr 2022 at 12:23, jodersky ***@***.***> wrote:
What version of Scala are you using? From the scalacOptions I would
assume Scala 3. Can you confirm?
—
Reply to this email directly, view it on GitHub
<#386 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF57BUBGA7UK65C3ZPXJS4DVF2CTNANCNFSM5TYIICQQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Perhaps noteworthy, I have these in scope...
I'll look into seeing if I can produce a minimal example if I can get some time. It's all otherwise the "default" upickle behaviour |
That would be very helpful, thank you! Without rushing to conclusions, here are some potentially relevant points:
|
I've wanted to experiment with mill tasks for a while... which I'm not totally sure if it was successful, but this repo might help with a reproduction. |
The above comment was wrong, and not really relevant to this issue. |
This is still an issue. We have tests that pass on Scala 2 that currently do not pass on Scala 3 Might need help from Scala 3 compiler folks to help figure this out |
From what I can tell, this works in 3.3.1 with |
Turn on tests to verify #386 Scala 3 tests were accidentally disabled in #553, this re-enables them The big-case-class tests do work, with the caveat you need to set `-Xmax-inlines` to be greater than the width of your case class, and the compilation is notably slower on 3.3.1 than in Scala 213.11. However, the performance seems to be better in 3.4.0, and `-Xmax-inlines` is no longer necessary. For now, I just add `-Xmax-inlines` and accept the compilation slowness, so as to not break anyone using Scala 3.3.1. Eventually, as people upgrade to 3.4.0, the problem can be expected to go away
I have a large case class (let's say 65ish fields). If commen out random subsets of these fields - i.e. reduce the number of parameters, compilation works fine.
All fields are basically all doubles, strings, or Option[Double] Option[String]
Naive compilations gets me this error;
If I follow the error message (which is great) and set this;
I can compile a "smaller" version of the case class. If I boost that "max-inlines" to 128, then I get a stackoverflow error.
Even setting this in ".mill-jvm-opts"
Which I feel is rather generous, getd me this in compile.log;
I'm aware that historically, one couldn't go beyond 21 fields or so. My questions:
Would this be expected to work?
Any hints?
I feel like this is a bug somewhere, as it causes a compiler stackoverflow, with what I feel is not an unreasonable amount of data. I do not claim certainty, that it is a bug, or that the bug is in upickle.
The text was updated successfully, but these errors were encountered: