Unexpected compilation errors unknown:0:1:
Closed this issue · 4 comments
VlachJosef commented
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
I can't reproduce it locally. Could you tell me what Scala version and compiler plugins you're using?
VlachJosef commented
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
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 ***@***.***> 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.