Closed as not planned
Description
Compiler version
3.5.0
(I have tested the issue does not exists with (2.13.14, 3.0.0. 3.2.0 or 3.4.2)
Minimized code
ClassA.scala:
object ClassA {
def a: String = "b"
}
Main.scala:
object Main {
def main(args: Array[String]): Unit = {
println("Hello world!x")
}
}
build.sbt:
scalaVersion := "3.5.0"
- From SBT use
compile
- Change "b" in ClassA.scala to "a"
- From SBT use
compile
again.
Output
[info] compiling 2 Scala sources to C:\Dev\inc\target\scala-3.5.0\classes ...
Expectation
Only 1 file should be compiled. There is no reason to compile both. This is the output I get with all previous compiler versions:
[info] compiling 1 Scala source to C:\Dev\inc\target\scala-3.4.2\classes ...
Note
I observe much worse incremental compilation in my real world project. Even when doing just a small change in my code, most of files are compiled and compilation takes very long. It is hard to be sure the issue here is representative of the real issue, but it certainly looks suspicious and strange.