[squeak-dev] Local variable does not shadow instance variable?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Local variable does not shadow instance variable?

Sophie424
Why does "x" as a local variable not shadow an inst-var "x"?

Object subclass: #Foo
 instanceVariableNames: 'x' <-- sometimes compile error here

Foo>>m
 | x | <-- sometimes compile error here

I tried to add an inst-var to one of my classes, and was forced to update
local vars in some methods (or to use a different inst-var name).

Thanks