Shadowing of variables #1582
MerlinEgalite
started this conversation in
General
Replies: 2 comments 19 replies
-
@QGarchery also suggested (#1545 (comment)):
I would suggest:
|
Beta Was this translation helpful? Give feedback.
11 replies
-
The only problem I see with shadowing variables is that state variables may not be changed (because changes will apply to the shadowing variable), whereas the developer might expect changes . If the shadowing variable is not of the same type then I think it is fine to shadow, because the compiler will not accept wrong code. Do we agree that it is ok to shadow a state variable name with another variable of a different type ? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Kickstarting a discussion for a general solution for the shadowing of variables.
Here are a few options already mentioned:
Mem
to the end of a var.Beta Was this translation helpful? Give feedback.
All reactions