Skip to content

TASTy reflect use complete definition trees #4968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2018

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Aug 20, 2018

TASTy reflect trees are loaded by finding the tree from the current top-level class tree. This only works when -Yretain-trees is enabled, otherwise the three is still synthesized.

@nicolasstucki nicolasstucki self-assigned this Aug 20, 2018
@nicolasstucki nicolasstucki changed the title Tasty reflect load complete definition trees TASTy reflect load complete definition trees Aug 22, 2018
@nicolasstucki nicolasstucki force-pushed the load-tree-for-symbol branch 2 times, most recently from 3736296 to 1e40bd1 Compare August 28, 2018 08:03
@nicolasstucki nicolasstucki requested a review from odersky August 30, 2018 09:51
@nicolasstucki
Copy link
Contributor Author

Rebased

@nicolasstucki nicolasstucki force-pushed the load-tree-for-symbol branch 2 times, most recently from f8c5b25 to 41bc57a Compare September 20, 2018 18:04
@nicolasstucki nicolasstucki force-pushed the load-tree-for-symbol branch 2 times, most recently from 9aacd4c to 6446173 Compare September 21, 2018 13:36
Currently only works with -Yretain-tree.

Also fix an issue with TASTy reflect
@nicolasstucki
Copy link
Contributor Author

Rebased

@nicolasstucki
Copy link
Contributor Author

@odersky, now this PR used the defTree of symbols to get the trees within TASTy reflect.

@nicolasstucki nicolasstucki requested review from liufengyun and removed request for odersky October 1, 2018 15:27
@nicolasstucki nicolasstucki changed the title TASTy reflect load complete definition trees TASTy reflect use complete definition trees Oct 1, 2018
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -286,7 +286,7 @@ trait TreeOps extends TastyCore {

val Inlined: InlinedExtractor
abstract class InlinedExtractor {
def unapply(tree: Tree)(implicit ctx: Context): Option[(Option[Term], List[Definition], Term)]
def unapply(tree: Tree)(implicit ctx: Context): Option[(Option[Parent], List[Definition], Term)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, Parent is the type of the tree in the parent list. Using here, it's a little difficult to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will change Parent to TermOrTypeTree in another PR. When bootstrapped it will be Term | TypeTree.

@nicolasstucki nicolasstucki merged commit 8a9770b into scala:master Oct 2, 2018
@nicolasstucki nicolasstucki deleted the load-tree-for-symbol branch October 2, 2018 12:38
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.

3 participants