Skip to content
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

Handle SummonFrom in reflect TreeAccumulator #14809

Merged
merged 4 commits into from Mar 30, 2022

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Mar 29, 2022

SummonFrom can never be seen from macros as they are always evaluated away before expanding the macro. This can be seen if an inline tree definition is loaded and traversed as is the case with the TastyInspector.

Fixes #14789

Print the tree extractors of the reflection API instead of the
underlying case class toString.
@nicolasstucki nicolasstucki self-assigned this Mar 29, 2022
* Add SummonFrom case
* Fix bug with PackageClause case
* Complete ClassDef case
@nicolasstucki nicolasstucki marked this pull request as ready for review March 30, 2022 07:00
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM.

val constructor @ DefDef(_, _, _, _) = transformStatement(tree.constructor)(tree.symbol)
val parents = tree.parents.map(transformTree(_)(tree.symbol))
val body = tree.body.map(transformStatement(_)(tree.symbol))
ClassDef.copy(tree)(tree.name, constructor, parents, tree.self, body)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed it. Added.

@smarter smarter assigned nicolasstucki and unassigned smarter Mar 30, 2022
@smarter smarter enabled auto-merge March 30, 2022 11:23
@smarter smarter merged commit ee6733a into scala:main Mar 30, 2022
@smarter smarter deleted the fix-14789 branch March 30, 2022 12:53
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 2, 2023
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.

TreeTraverser throw MatchError: InlineMatch
3 participants