Duhemm / sbt-errors-summary

sbt plugin to show a summary of compilation messages.
MIT License
201 stars 11 forks source link

Unexpected compilation errors unknown:0:1: #23

Closed VlachJosef closed 7 years ago

VlachJosef commented 7 years ago

When trying to compile this simple program with one type error:

object Hello {
  final def main(args: Array[String]) = {
    val s: Int = "hello"
  }
}

Following are errors reported:

[error] [1] src/main/scala/main.scala:5:18:
[error]     type mismatch;
[error]      found   : String("hello")
[error]      required: Int
[error]         val s: Int = "hello"
[error]                      ^
[info] [2] unknown:0:1:
[info]     String("hello") <: Int?
[info]     
[info] [3] unknown:0:1:
[info]     false
[info]     
[error] src/main/scala/main.scala: 5 [1]
[error] unknown: 0 [2], 0 [3]
[error] (compile:compileIncremental) Compilation failed

Errors [2] and [3] should not be printed.

Duhemm commented 7 years ago

I can't reproduce it locally. Could you tell me what Scala version and compiler plugins you're using?

VlachJosef commented 7 years ago

Oh, I didn't realize I have -explaintypes in scalacOptions.

But still it may be little more convenient to print these information as sbt is doing:

[error] /Users/me/dev/sbt-errors-test/src/main/scala/main.scala:5: type mismatch;
[error]  found   : String("hello")
[error]  required: Int
[error]     val s: Int = "hello"
[error]                  ^
[info] String("hello") <: Int?
[info] false
[error] one error found
[error] (compile:compileIncremental) Compilation failed
Duhemm commented 7 years ago

Thanks! The way we show errors for "unknown" file must be reworked.

Thanks for the report, il' see what I can do.

On 11 Jul 2017, at 13:49, Josef Vlach notifications@github.com wrote:

Oh, I didn't realize I have -explaintypes in scalacOptions.

But still it may be little more convenient to print these information as sbt is doing:

[error] /Users/me/dev/sbt-errors-test/src/main/scala/main.scala:5: type mismatch; [error] found : String("hello") [error] required: Int [error] val s: Int = "hello" [error] ^ [info] String("hello") <: Int? [info] false [error] one error found [error] (compile:compileIncremental) Compilation failed — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Duhemm commented 7 years ago

Fixed in #24