-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
Print the tree extractors of the reflection API instead of the underlying case class toString.
* Add SummonFrom case * Fix bug with PackageClause case * Complete ClassDef case
There was a problem hiding this 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason tree.self isn't transformed? It's transformed in the compiler TreeMap: https://github.com/lampepfl/dotty/blob/e8356687e294d8a6274c1decf271fbcc43275e5a/compiler/src/dotty/tools/dotc/ast/Trees.scala#L1468
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed it. Added.
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