Let's say we have:
// A.scala
object A {
final val x = 12
}
// B.scala
object B {
def abc: Int = A.x
}
and we'll change A.scala so it looks like this:
// A.scala
object A {
final val x = "foo"
}
then name hashing won't trigger recompilation of B and won't realize there's a compilation error. The reason is that A.x has a constant type inferred. When we refer to it from B, we get the constant inlined by Scala's type checker and any trace that there was dependency on A.x is gone.
The fix for this issue has to happen on Scala compiler side, see SI-7173.
Let's say we have:
and we'll change
A.scalaso it looks like this:then name hashing won't trigger recompilation of B and won't realize there's a compilation error. The reason is that
A.xhas a constant type inferred. When we refer to it from B, we get the constant inlined by Scala's type checker and any trace that there was dependency onA.xis gone.The fix for this issue has to happen on Scala compiler side, see SI-7173.