Comments (9)
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
Last good nightly (raising the error): 3.3.2-RC1-bin-20230717-2753a17-NIGHTLY
First nightly introducing the problem: 3.3.2-RC1-bin-20230718-da16f43-NIGHTLY
The compilation still hangs on Next 3.4.0
First Next nightly to fix it (have the error again, rather than hang): 3.4.1-RC1-bin-20240122-ca18f4a-NIGHTLY
First good Next is 3.4.1
from scala3.
I was able to reproduce on my another system, with smaller memory.
from scala3.
You need scala cli 1.3.1
from scala3.
The bisect for a fix seems to point to 708e640, cherry-pick to the current LTS seems to fix the issue
from scala3.
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.
from scala3.
I couldn't reproduce the infinite hang in LTS (3.3.3), 3.4, or nightly
> scala-cli compile -S 3.lts Stest.scala
Compiling project (Scala 3.3.3, JVM (11))
[error] ./Stest.scala:234:26
[error] Could not infer type for parameter _$3 of anonymous function
[error]
[error] In expanded function:
[error] (_$1, _$2, _$3) => new ExampleClass(_$1, _$2, _$3)
[error] new ExampleClass(_, _, _)
[error] ^
Error compiling project (Scala 3.3.3, JVM (11))
Compilation failed
Although the error is different in 3.3.
from scala3.
@noti0na1 How did you use "3.lts" as Scala Version for scala-cli?
When i try to execute your command the output is:
[error] Cannot find matching Scala version for '3.lts
You can only choose one of the 3.x, 2.13.x, and 2.12.x. versions.
The latest supported stable versions are 2.12.17, 2.13.10, 3.2.2.
In addition, you can request compilation with the last nightly versions of Scala,
by passing the 2.nightly, 2.12.nightly, 2.13.nightly, or 3.nightly arguments.
Specific Scala 2 or Scala 3 nightly versions are also accepted.
Even with scala-cli, you can reproduce the error using
- Scala-CLI version 1.0.0-RC2
- OpenJDK 19
- Scala 3.3.3
> scala-cli compile -S 3.3.3 Stest.scala
Starting compilation server
Compiling project (Scala 3.3.3, JVM)
And it hangs until java.lang.OutOfMemoryError: Java heap space
from scala3.
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"
- Scala-CLI version 1.0.0-RC2
- OpenJDK 21
- Scala 3.3.3 (using the 3.lts version at scala-cli)
> scala-cli compile -S 3.lts Stest.scala
Starting compilation server
Compiling project (Scala 3.3.3, JVM (21))
And it does nothing from there.
from scala3.
The nightly versions I found may related to this issue:
- 3.4.0-RC1-bin-20240105-d2cc3ae-NIGHTLY
- 3.4.0-RC1-bin-20240106-c15cc9c-NIGHTLY
from scala3.
Related Issues (20)
- IndexOutOfBoundsException on wrong number of type params of polymorphic function
- Renaming `specialized` on import results in "unused import" warnings HOT 3
- `compiletime.uninitialized` refuses to compile in local position HOT 4
- Regression 3.4.0+: scenario where Tuple.InverseMap does not compute the expected type HOT 2
- Inconsistencies in reporting deprecations with creator applications, aliases HOT 1
- Scaladoc: better `-external-mappings` (working on packages instead of paths)
- NullPointerException with type lambda + match type HOT 2
- Compiler should enforce named arguments for Java annotations
- Loading coursier-interfaces crashes the compiler HOT 2
- TypeError: object caps does not have a member type Cap HOT 2
- odd evaluation order when using extension method named `|` as infix method HOT 1
- `java.sql.Driver` missing from classpath in macro in presentation compiler
- Scala Pattern Matching on Java Records (JEP-440) HOT 1
- Seq from unsafe wrapped array fails to deconstruct in head and tail with pattern matching HOT 3
- No type-mismatch error in fewer-braces code when using context function
- Match type reduction including function types HOT 1
- Incorrect warning about ambiguous implicit
- Nightly Dotty workflow of 2024-06-15 failed
- Nested overloaded inline methods crash the compiler when imported from exported object
- Nightly Dotty workflow of 2024-06-16 failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala3.