mirror of https://github.com/sbt/sbt.git
Classes that only inherit a macro don't have a macro
Prior to this commit, a class that inherited a macro from another class was considered by incremental compiler as having a macro. Now, only classes that explicitly define a macro are considered as having a macro. This influences decision whether to invalidate (recompile) dependencies of a file that inherits a macro upon a whitespace change. From now on, we don't invalidate dependencies in such case which results in much better incremental compiler experience when macros are being involved. Check #1142 for detailed discussion. The change to the behavior is reflected by marking the source-dependencies/inherited-macros test as passing. The source-dependencies/macro test covers the case of defining the macro directly in source file. Therefore we know that the desired behavior of invalidating dependencies of macros is preserved. Fixes #1142
This commit is contained in:
parent
b5b07348f0
commit
5a40641cc1
|
|
@ -29,6 +29,14 @@ object APIUtil
|
|||
{
|
||||
var hasMacro = false
|
||||
|
||||
// Don't visit inherited definitions since we consider that a class
|
||||
// that inherits a macro does not have a macro.
|
||||
override def visitStructure0(structure: Structure)
|
||||
{
|
||||
visitTypes(structure.parents)
|
||||
visitDefinitions(structure.declared)
|
||||
}
|
||||
|
||||
override def visitModifiers(m: Modifiers)
|
||||
{
|
||||
hasMacro ||= m.isMacro
|
||||
|
|
|
|||
Loading…
Reference in New Issue