Skip to content

Name hashing: Members with constant types are not tracked #1543

@gkossakowski

Description

@gkossakowski

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions