Skip to content

Macro-Generated Field Referencing #13073

Discussion options

You must be logged in to vote

I don't know if there is a way to splice these into quasiquotes. When working with reflect trees, a Term can represent an instance of a class, and a Symbol can represent a method or field name. If you have a Term representing an object (probably from Expr#asTerm) and a Symbol representing the field, you can create a tree that calls the field on the object by creating a Select tree, either with Term#select or one of the SelectModule methods. Then the Select tree can be turned back into an Expr with Term#asExprOf.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zeimyth
Comment options

Answer selected by Zeimyth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants