-
Notifications
You must be signed in to change notification settings - Fork 86
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
Check that name shadowing with "simple" local variables is still prohibited #1131
Comments
Hmm. 7.3 still contains:
Notes on this:
Effectively, I think we want to have a concept that differentiates between just "local variable declaration space X with a nested local variable declaration space Y" and "local variable declaration space X with a nested local variable declaration space Y that's introduced by a anonymous-function/local-function". If each local variable declaration space had an "owner" which was one of:
... then we could say "it is an error for a local variable declaration space and a nested local variable declaration space with the same owner to contain elements with the same name". I don't think "owner" is the right term here, but I think that's what we want in some form. Let's discuss. |
@jskeet is correct, #608 got it wrong or at least didn't go far enough… The text in question is at the end, I've changed bullets to numbers to make it easier. So #608 altered (7) with the intention of covering function-like things (™ 😉) declared within function-like things allowing hiding. However (8.ii) contradicts this for function members, anonymous functions and local functions. Facing this might be as simple as removing (8.ii), removing any references to local functions and friends from (8), and making sure we’re happy (7) is correct – which we were when we looked at it in isolation… I’m not suggesting changes right now, got to be somewhere else, I may or may not get back to this before the meeting so I'm posting this to give Jon something to work on 😉. Disclaimer: I could of course be wrong…
|
Jon to see if he can come up with different names for the different kinds of local variable declaration spaces - and apply them accurately. |
Also, within 13.6.2.1:
That is no longer correct, and will need addressing too. |
This is for Jon to convince himself (and document here) that the concern in #608 is not a problem.
The text was updated successfully, but these errors were encountered: