Shadowed variables [was: Re: animated gifs]

Ned Konz ned at squeakland.org
Tue Feb 22 23:23:35 UTC 2005


On Tuesday 22 February 2005 2:10 pm, Dan Ingalls wrote:
> >On Tuesday 22 February 2005 12:31 am, Scott Wallace wrote:
> >> Hi,
> >>
> >> Does anyone have any recent experience with using animated GIFs in
> >> Squeak?
> >>
> >> Theoretically animated-gif support arrived in Squeak 3.7.  However, I
> >> have not been able successfully to load any animated gif into any
> >> 3.7- or 3.8-based version of Squeak.  Whenever I try to "open" an
> >> animated gif from a file-list, I always get an error.  Does this
> >> happen to anyone else?
> >>
> >> Any advice much appreciated!
> >
> >Remove the local 'offset' variable in AnimatedGIFReadWriter>>allImages;
> > it's shadowing the instance variable.
>
> Just a note about QA of releases.  In the "old days", shadowing was
> considered an error, and one of the pre-release procedures was to recompile
> the whole system.  Thus, this bug would have been caught.
>
> If we are going to allow this kind of shadowing, then I suggest that there
> be a system test equivalent to recompiling the system and locating shadowed
> variables.  They should be as much of a red flag as references to
> Undeclared.

This sounds like something that should be added to the set of Lint rules in 
the Refactoring Browser. I've already added tests for calling 'super new 
initialize' from class methods, and for calling known deprecated methods on a 
known global, for instance.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list