Skip to content

Avoid spurious recompilations when unrelated constructor changes #97

@smarter

Description

@smarter

A.scala:

class A(a: Int) // change Int to String, B.scala should not be recompiled
object A { val x = 3 }

B.scala:

class B { val y = A.x }

B does not use the constructor of A, but every constructor has the same name <init>, so if we change a constructor in a class, then all dependencies of that class are inevitably recompiled. This should be easy to fix: just special case constructors and prepend the class name to the method name, like A<init>, B<init>.

(Note that this change will break value-class-underlying if #95 gets merged (see the PR description), this can be fixed by including the underlying val of a value class in its name hash)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions