scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

Distinguish warnings configured to error from "compiler-native" errors #12831

Closed som-snytt closed 11 months ago

som-snytt commented 11 months ago

Reproduction steps

Scala version: 2.13.11

➜  ~ scala -Wconf:cat=deprecation:e
Welcome to Scala 2.13.11 (OpenJDK 64-Bit Server VM, Java 20.0.1).
Type in expressions for evaluation. Or try :help.

scala> @deprecated("","") def f = 42

         lazy val $result = $line3.$read.INSTANCE.$iw.f
                                                      ^
<synthetic>:4: error: method f is deprecated

(To diagnose errors in synthetic code, try adding `// show` to the end of your input.)

scala> def f: String = 42
                       ^
       error: type mismatch;
        found   : Int(42)
        required: String

scala>

Problem

The word "error" is in red in both messages, but one is a boosted error.

Maybe boosted errors could be purple.

som-snytt commented 11 months ago

It wouldn't be terrible if the summary detected that there were boosted errors and added a message about -Wconf.

Noticed at https://github.com/scala/scala/pull/10439

lrytz commented 11 months ago

It's also fine if we append text to the message. As long as they are reported as errors something needs to be done to addres them, so it's less important to keep the message compact. Purple isn't passed through to bichromatic IDEs.