Skip to content
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

Scala CLI prints errors from the previous compilation #2226

Open
lwronski opened this issue Jun 19, 2023 · 2 comments
Open

Scala CLI prints errors from the previous compilation #2226

lwronski opened this issue Jun 19, 2023 · 2 comments
Assignees
Labels
blocked upstream Issues and changes blocked by something in an external project. Bloop Issues tied with Bloop integration. bug Something isn't working

Comments

@lwronski
Copy link
Contributor

Version(s)
1.0.1

Describe the bug
Scala CLI prints errors from the previous compilation

To Reproduce

$ cat Hello.scala
//> using scala 3.3.0

object Main extends App {
    val msg: String = "1"
}
$ scala-cli compile Hello.scala
Compiling project (Scala 3.3.0, JVM)
Compiled project (Scala 3.3.0, JVM)
$ cat Hello.scala
//> using scala 3.3.0

object Main extends App {
    val msg: String = 1
}
scala-cli compile Hello.scala
Compiling project (Scala 3.3.0, JVM)
[error] ./Hello.scala:4:23
[error] Found:    (1 : Int)
[error] Required: String
[error]     val msg: String = 1
[error]                       ^
Error compiling project (Scala 3.3.0, JVM)
Compilation failed
$ cat Hello.scala
//> using scala 3.3.0

object Main extends App {
    val msg: String = "1"
}
$ scala-cli compile Hello.scala
[error] ./Hello.scala:4:23
[error] Found:    (1 : Int)
[error] Required: String
[error]     val msg: String = "1"
[error]                       ^

It should not print the error at the end because the code is compiling fine.

@lwronski lwronski added the bug Something isn't working label Jun 19, 2023
@tgodzik tgodzik self-assigned this Jun 28, 2023
@Gedochao Gedochao added the requires scoping Issue requires a spike to revalidate it and assign an up-to date scope for its requirements. label Apr 12, 2024
@tgodzik
Copy link
Member

tgodzik commented Apr 15, 2024

I checked again and it seems to still fail, but it only fails for Scala CLI if the current file returns to the previous compiling code. If it's changed in any way this doesn't show up.

Also, I run using plain Bloop command and this didn't show up, so my guess is that we cache something inside Scala CLI itself

@tgodzik tgodzik removed the requires scoping Issue requires a spike to revalidate it and assign an up-to date scope for its requirements. label Apr 15, 2024
@tgodzik tgodzik removed their assignment Apr 15, 2024
@Gedochao Gedochao added blocked upstream Issues and changes blocked by something in an external project. Bloop Issues tied with Bloop integration. labels Jun 26, 2024
@tgodzik tgodzik self-assigned this Sep 10, 2024
@tgodzik tgodzik moved this from To do to In progress in Issue Board Sep 10, 2024
tgodzik added a commit to tgodzik/bloop that referenced this issue Sep 10, 2024
We need to report all problems if a BSP client just connected to the server and never compiled.
`reportAllPreviousProblems` will be set to true in that case.

However, if previously we had an error, which was reverted and got back to the state before the
error, we will get a successfull noop compilation, which will not produce any problems.

In this case we don't want to republish everything again, since diagnostics will contain the
error which was reverted.

Connected to VirtusLab/scala-cli#2226 where CLI always connected anew.
tgodzik added a commit to tgodzik/bloop that referenced this issue Sep 11, 2024
We need to report all problems if a BSP client just connected to the server and never compiled.
`reportAllPreviousProblems` will be set to true in that case.

However, if previously we had an error, which was reverted and got back to the state before the
error, we will get a successfull noop compilation, which will not produce any problems.

In this case we don't want to republish everything again, since diagnostics will contain the
error which was reverted.

Connected to VirtusLab/scala-cli#2226 where CLI always connected anew.
@Gedochao Gedochao assigned tgodzik and unassigned tgodzik Dec 11, 2024
@Gedochao
Copy link
Contributor

bump @tgodzik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked upstream Issues and changes blocked by something in an external project. Bloop Issues tied with Bloop integration. bug Something isn't working
Projects
Status: In progress
Development

No branches or pull requests

3 participants