-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Infinite compile time when exceeded amount of parameters of class #20134
Comments
Fails at compile time in Next (3.4.1) -- [E081] Type Error: /Users/pchabelski/IdeaProjects/scala-cli-tests/compiler-repro/.scala-build/compiler-repro_b7340921ea-40b92162c2/src_generated/main/smth.scala:13:27
13 |fun(new ExampleClass(_, _, _))
| ^
| Missing parameter type
|
| I could not infer the type of the parameter _$3
| in expanded function:
| (_$1, _$2, _$3) => new smth$_.this.ExampleClass(_$1, _$2, _$3)
| Expected type for the whole anonymous function:
| In
|
| where: In is a type variable
1 error found
Compilation failed The compilation indeed hangs in LTS. |
So this unfortunately looks like a regression on the LTS. The last LTS to fail correctly in compile time: 3.3.1 -- [E081] Type Error: /Users/pchabelski/IdeaProjects/scala-cli-tests/compiler-repro/.scala-build/compiler-repro_a69ec373e9-40b92162c2/src_generated/main/smth.scala:13:27
13 |fun(new ExampleClass(_, _, _))
| ^
| Missing parameter type
|
| I could not infer the type of the parameter _$3 of expanded function:
| (_$1, _$2, _$3) => new smth$_.this.ExampleClass(_$1, _$2, _$3).
1 error found
Compilation failed The first LTS to hang on infinite compilation: 3.3.2 The compilation still hangs on Next 3.4.0 |
I couldn't reproduce the infinite hang in LTS (3.3.3), 3.4, or nightly
Although the error is different in 3.3. |
@noti0na1 How did you use "3.lts" as Scala Version for scala-cli? When i try to execute your command the output is:
Even with scala-cli, you can reproduce the error using
And it hangs until java.lang.OutOfMemoryError: Java heap space |
You need scala cli 1.3.1 |
Thanks @He-Pin, the latest Scala-cli version that i got from my distro is 1.3.0 but it was enough to run the command. scala-cli updated and it stills goes to "infinite compiling"
And it does nothing from there. |
I was able to reproduce on my another system, with smaller memory. |
The nightly versions I found may related to this issue:
|
The bisect for a fix seems to point to 708e640, cherry-pick to the current LTS seems to fix the issue |
Compiler version
Scala: 3.3.3
Minimized code
Output
java.lang.OutOfMemoryError: Java heap space
Expectation
An error at compile time because the exceeded parameter of "ExampleClass", it just tries to compile until the java heap space is over.
The text was updated successfully, but these errors were encountered: