Fixes incremental compiler missing member ref from macro expansion sbt/sbt#2560#2563
Merged
Fixes incremental compiler missing member ref from macro expansion sbt/sbt#2560#2563
Conversation
Contributor
|
It looks like the test failure is legit. |
Member
Author
|
@gkossakowski There's been failures on that test prior to this PR - #2546 |
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.
739e223 to
c971d7f
Compare
Contributor
|
LGTM |
7 tasks
Member
Author
|
Zinc portion of forward porting: sbt/zinc#111 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 expandedtree is not traversed, and thus the reference to
Baris not caughtduring 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