Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Direction of tree-walkign in the compiler PluginPhase #17093

Discussion options

I'm trying to write a small compiler plugin phase, which should apply to DefDefs transformation from top to bottom.
But I see default evaluation sequence is from bottom to top:

I.e, during processing next code:

object X {
 def a(): A=>B = {
 a => b
 }
}

transformDefDef at first applied to internal lambda function. X.a.$anonfun then to X.a

So, question - is it possible to change tree-walking strategy for compiler phase ?

//.btw, find a way to process only top-level defdefs

Thanks!

You must be logged in to vote

Answer to self after reading sources of MiniPhase/MegaPhase: no. (i.e. for excluding child nodes need to have analyzer or selection phase before our phase).

Replies: 1 comment

Comment options

Answer to self after reading sources of MiniPhase/MegaPhase: no. (i.e. for excluding child nodes need to have analyzer or selection phase before our phase).

You must be logged in to vote
0 replies
Answer selected by ckipp01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /