[Cuis-dev] TemporaryToInstanceVariable Refactor with Arguments

Hernan Wilkinson hernan.wilkinson at 10pines.com
Mon Dec 23 04:05:17 PST 2019


Thanks Erik!
Integrated :-)

I made a few refactorings because I created CodeNode as superclass of
BlockNode and MethodNode to have some consistency when asking for
temporaries and arguments. Please take a look so you are aware of that for
next time

On Sun, Dec 22, 2019 at 7:45 PM Eric Brandwein via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Hi all,
>
> Continuing to the fixes to refactors, here's one for two bugs in
> TemporaryToInstanceVariable.
> First, the SmalltalkEditor wouldn't check if you were actually extracting
> a temporary and not an argument, because both of them are
> TempVariableNodes. This means you could try to make the Temporary to
> Instance Variable refactor on an argument, and the debugger would pop up.
>
> Second, the TemporaryToInstanceVariable class didn't check if there was
> already other block declaring an argument with the same name as the
> temporary you were trying to extract, and so when trying to compile the
> method without the temporary declaration the Parser would throw an error.
> This one can be reproduced by writing this method:
>
> m1
>     [ :a | ^a ].
>     [ | a | ^a ].
>
> and calling the refactor on the declaration of a on the second block.
>
> Cheers,
> Eric
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191223/bbad7627/attachment.htm>


More information about the Cuis-dev mailing list