Duhemm/sbt-errors-summary

Unexpected compilation errors unknown:0:1:

Closed this issue · 4 comments

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.

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

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

Fixed in #24