Skip to content

Fixes incremental compiler missing member ref from macro expansion sbt/sbt#2560#2563

Merged
eed3si9n merged 3 commits intosbt:0.13from
eed3si9n:wip/macro-nonarg-dep
Apr 19, 2016
Merged

Fixes incremental compiler missing member ref from macro expansion sbt/sbt#2560#2563
eed3si9n merged 3 commits intosbt:0.13from
eed3si9n:wip/macro-nonarg-dep

Conversation

@eed3si9n
Copy link
Member

Fixes #2560

Unlike other scripted macro tests, the call site of the macro I added for this repro is
Provider.tree(0), which itself does not introduce internal member reference.
Instead the macro expansion calls Bar.bar(0). Due to #2560, the expanded
tree is not traversed, and thus the reference to Bar is not caught
during incremental compilation.

The fix is a one-liner change to traverse the expanded tree, which we used to do prior to 0.13.11 (0f61629).

/review @gkossakowski, @Duhemm

@gkossakowski
Copy link
Contributor

It looks like the test failure is legit.

@eed3si9n
Copy link
Member Author

@gkossakowski There's been failures on that test prior to this PR - #2546

Fixes sbt#2546. Ref sbt#958
scripted compiler-project/error-in-invalidated has been failing
frequently on Travis CI. It seems like incremental compiler is not
catching the change in source occasionally for `changes/A2.scala`.
Unlike other scripted macro tests, the call site of this macro is
`Provider.tree(0)`, which does not introduce internal member reference.
Instead the macro itself calls `Bar.bar(0)`. Due to sbt#2560, the expanded
tree is not traversed, and thus the reference to `Bar` is not caught
during incremental compilation.
traverse(tree: Tree) used to call super.traverse(tree) at the end.
sbt/sbt@0f61629 brought the traversing
call to inside of the pattern matching.
For the case of MacroExpansionOf(original), it amounts to not traveling
the macro-expanded code. See
sbt/src/sbt-test/source-dependencies/macro-nonarg-dep for the repro.
@eed3si9n eed3si9n force-pushed the wip/macro-nonarg-dep branch from 739e223 to c971d7f Compare April 18, 2016 18:12
@gkossakowski
Copy link
Contributor

LGTM

@eed3si9n eed3si9n merged commit ce611fb into sbt:0.13 Apr 19, 2016
@eed3si9n eed3si9n deleted the wip/macro-nonarg-dep branch April 19, 2016 14:57
@eed3si9n eed3si9n mentioned this pull request May 1, 2016
7 tasks
@eed3si9n
Copy link
Member Author

eed3si9n commented May 2, 2016

Zinc portion of forward porting: sbt/zinc#111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants