You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
object A {
inline def f(x: Int) = x * 2
def main(args: Array[String]): Unit = {
println(f(10))
}
}
object B {
inline def g(x: Int) = A.f(x) * 2
def main(args: Array[String]): Unit = {
println(g(10))
}
}
object C {
inline def h(x: Int) = B.g(x) * 2
def main(args: Array[String]): Unit = {
println(h(10))
}
}
Compile and run C.main; the output is 80.
problem
Now change the constant in A.f to 4 and recompile. Only 2 files get recompiled and the output of C.main is still 80.
expectation
After changing A.f, all files get recompiled and the output of C.main is correct.
notes
There seems to be now way to disable inlining in Scala 3. Hence it is very important that incremental compilation produces a correct result when an inlined method was changed. At the very least, a full rebuild should be triggered.
The text was updated successfully, but these errors were encountered:
Duplicate of scala/scala3#11861 (incremental compilation in scala 3 is implemented in the compiler repository, not in zinc's repository) Also note that there's an open pr for this issue: scala/scala3#12931
versions
Scala 3.0.1, Mill 0.9.9, Zinc 1.5.5
steps
Put the following objects into separate files:
Compile and run
C.main
; the output is80
.problem
Now change the constant in
A.f
to 4 and recompile. Only 2 files get recompiled and the output ofC.main
is still 80.expectation
After changing
A.f
, all files get recompiled and the output ofC.main
is correct.notes
There seems to be now way to disable inlining in Scala 3. Hence it is very important that incremental compilation produces a correct result when an inlined method was changed. At the very least, a full rebuild should be triggered.
The text was updated successfully, but these errors were encountered: