Scala3 doesn't display type mismatch or format errors in Intellij

I'm using Scala 3.3.1 and Intellij isn't giving me helpful build error outputs and no error highlighting.

For example, if my project uses any 3.x Scala SDK, and I have the following incorrect code, it does not display anything on the IDE itself to tell me there is a type error:

And when compiling, the console output is always the same thing no matter what error it is.

scalac: Error: 'java.lang.String dotty.tools.dotc.reporting.Message.msg()'
java.lang.NoSuchMethodError: 'java.lang.String dotty.tools.dotc.reporting.Message.msg()'
    at dotty.tools.xsbt.DelegatingReporter.doReport(DelegatingReporter.java:47)
    at dotty.tools.dotc.reporting.Reporter.issueUnconfigured(Reporter.scala:158)
    at dotty.tools.dotc.reporting.Reporter.go$1(Reporter.scala:181)
    at dotty.tools.dotc.reporting.Reporter.issueIfNotSuppressed(Reporter.scala:200)
    at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:203)
    (etc...)

My project involves a lot of complicated types and methods and when every time there is a type mismatch, a misspelt variable or literally anything tiny out of place, IntelliJ tells me nothing at all about what the error might be or where it is, making my work almost impossible.

Oppositely, if I then reassign my project's SDK to Scala 2.x instead, what I want happening happens:


And equally, it returns helpful error messages:

(...)Main.scala:3:21
type mismatch;
 found   : String("test")
 required: Int
    val test: Int = "test"

Sadly my work wont let me use Scala 2 but it's becoming impossible without getting error messages and error highlighting like in Scala 2 on the same IDE. How can I fix this? 

2

I have similar issues with intelliJ 2023.3, but not in IintelliJ 2023.2.

0

Can you still reproduce the issue in the latest IntelliJ 2024.1?

0

请先登录再写评论。