Skip to content

Make context available in TreeTransform.prepareForXX methods #87

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
Mar 21, 2014

Conversation

gzm0
Copy link
Contributor

@gzm0 gzm0 commented Mar 20, 2014

No description provided.

@gzm0
Copy link
Contributor Author

gzm0 commented Mar 20, 2014

Review by @DarkDimius @odersky

@DarkDimius
Copy link
Contributor

It's not complete now: you should provide different context during prepareXXX for phases:
see for example line https://github.com/lampepfl/dotty/pull/87/files#diff-c08452fe3cae5864f9095c93722a1bc9L882
you should mutate with appropriate context from info

@DarkDimius
Copy link
Contributor

Why it's not complete: in this implementation all mini-phases share same context(which they implicitly got from TreeTransformer), with will have period of first mini-phase in group.

@@ -432,7 +432,7 @@ object TreeTransforms {
var allDone = i < l
while (i < l) {
val oldT = result(i)
val newT = mutator(oldT, tree)
val newT = ctx.atPhase(oldT)(mutator(oldT, tree, _))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DarkDimius you are saying this line should be the following?

val newT = mutator(oldT, tree, info.contexts(i))

Copy link
Contributor

Choose a reason for hiding this comment

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

Precisely.

@gzm0
Copy link
Contributor Author

gzm0 commented Mar 20, 2014

Updated

@DarkDimius
Copy link
Contributor

LGTM

DarkDimius added a commit that referenced this pull request Mar 21, 2014
Make context available in TreeTransform.prepareForXX methods
@DarkDimius DarkDimius merged commit a7d47ab into scala:master Mar 21, 2014
@gzm0 gzm0 deleted the context-in-prep-transform branch March 21, 2014 16:14
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this pull request Mar 19, 2025
Backport "Avoid orphan param from default arg" to 3.3 LTS
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