Skip to content

Rename ctx values #8654

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 9 commits into from
Apr 3, 2020
Merged

Rename ctx values #8654

merged 9 commits into from
Apr 3, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 2, 2020

We would like to distinguish between ctx referring to an enclosing parameter
and ctx referring to a field. This is so that we can at some point drop
ctx as a parameter name and just use (using Context). The ctx would then
go to an imported def in Contexts. But any other use of ctx does does not
follow strict nesting discipline can then change meaning, so we should
get these out of the way first.

odersky added 8 commits April 3, 2020 11:32
We would like to distinguish between `ctx` referring to an enclosing parameter
and `ctx` referring to a field. This is so that we can at some point drop
`ctx` as a parameter name and just use (using Context). The `ctx` would then
go to an imported def in `Contexts`. But any other use of `ctx` does does not
follow strict nesting discipline can then change meaning, so we should
get these out of the way first.
New master checks for inherited symbols shadowing definitions, so it contained
a number of changes where `ctx` in a map or an accumulator was renamed to `this.ctx`.
All of these broke because we renamed `ctx` in map to `mapCtx`. Before, all these
occurrences of `ctx` silently rebound in this PR to the enclosing `ctx` which is
mostly OK, since the two contexts tend to be the same, but could also be wrong.
So, the additional check has already apid for itself in increased robustness of
refactorings!
@odersky odersky merged commit 88129fc into scala:master Apr 3, 2020
@odersky odersky deleted the rename-ctx branch April 3, 2020 11:40
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.

2 participants