mirror of https://github.com/sbt/sbt.git
Include ONLY non-public members in API hash of traits
The previous logic was wrong and included all members of traits in their API hash, which degraded the performance of the incremental compiler. This commit changes this logic so that only the non-public members of traits are included into their API hash. Fixes #2436
This commit is contained in:
parent
207dd762f4
commit
be8ba763fa
|
|
@ -356,7 +356,12 @@ final class HashAPI(includePrivate: Boolean, includeParamNames: Boolean, include
|
|||
def hashStructure0(structure: Structure, includeDefinitions: Boolean, isTrait: Boolean = false): Unit = {
|
||||
extend(StructureHash)
|
||||
hashTypes(structure.parents, includeDefinitions)
|
||||
if (includeDefinitions || isTrait) {
|
||||
if (isTrait && !includeDefinitions) {
|
||||
def public(d: Definition): Boolean = d.access match { case _: xsbti.api.Public => true; case _ => false }
|
||||
hashDefinitions(structure.declared.filterNot(public), isTrait)
|
||||
hashDefinitions(structure.inherited.filterNot(public), isTrait)
|
||||
}
|
||||
if (includeDefinitions) {
|
||||
hashDefinitions(structure.declared, isTrait)
|
||||
hashDefinitions(structure.inherited, isTrait)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue