Giter VIP home page Giter VIP logo

Comments (9)

Gedochao avatar Gedochao commented on June 16, 2024 4

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.

noti0na1 avatar noti0na1 commented on June 16, 2024 2

I was able to reproduce on my another system, with smaller memory.

from scala3.

He-Pin avatar He-Pin commented on June 16, 2024 1

You need scala cli 1.3.1

from scala3.

WojciechMazur avatar WojciechMazur commented on June 16, 2024 1

The bisect for a fix seems to point to 708e640, cherry-pick to the current LTS seems to fix the issue

from scala3.

Gedochao avatar Gedochao commented on June 16, 2024

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.

noti0na1 avatar noti0na1 commented on June 16, 2024

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.

Nojipiz avatar Nojipiz commented on June 16, 2024

@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.

Nojipiz avatar Nojipiz commented on June 16, 2024

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.

noti0na1 avatar noti0na1 commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.