[Cuis-dev] Error when declaring undef. temp var

Hernan Wilkinson hernan.wilkinson at 10pines.com
Sun Dec 22 12:03:08 PST 2019


Thanks!
Integrated.

Hernan.

On Fri, Dec 20, 2019 at 9:02 PM Eric Brandwein <brandweineric at gmail.com>
wrote:

> Found it! The bug was happening when there where two undeclared
> temporaries being declared in the same block. Here's a ChangeSet that fixes
> that and other related issue with the corresponding tests.
>
> Cheers,
> Eric
>
> El vie., 20 dic. 2019 a las 14:44, Eric Brandwein (<
> brandweineric at gmail.com>) escribió:
>
>> Sure, I'll take a look at it later today.
>>
>> Il ven 20 dic 2019, 14:29 Hernan Wilkinson <hernan.wilkinson at 10pines.com>
>> ha scritto:
>>
>>> Hi Eric,
>>>  the other day I got an error when defining an undef. temp var when
>>> saving a method. the method was:
>>> -------
>>>  SafelyRemoveClass class>>#assertNoReferencesTo: aClassToSafelyRemove
>>>
>>> | references withAllSubclasses withAllSubclassesNames referenced |
>>>
>>> withAllSubclasses := aClassToSafelyRemove withAllSubclasses.
>>> withAllSubclassesNames := withAllSubclasses collect: [:aClass | aClass
>>> name ].
>>> references :=OrderedCollection new.
>>> referenced := OrderedCollection new.
>>> referencesToName := OrderedCollection new.
>>> referencedByName := OrderedCollection new.
>>>
>>> withAllSubclasses do: [ :aClass | | allReferences
>>> referencesOutsideHierarchy |
>>> allReferences := aClass allCallsOn.
>>> referencesOutsideHierarchy := allReferences reject: [ :aReference |
>>> withAllSubclassesNames includes: aReference classSymbol ].
>>> referencesToVariableBinding := referencesOutsideHierarchy select: [
>>> :aReference | aReference hasVariableBindingTo: aClass ].
>>> referencesToClassName := referencesOutsideHierarchy difference:
>>> referencesToVariableBinding.
>>>
>>> referencesToVariableBinding notEmpty ifTrue: [
>>> referenced add: aClass.
>>> references addAll: referencesToVariableBinding ].
>>> referencesToClassName notEmpty ifTrue: [
>>> referencedByName add: aClass.
>>> referencesToName addAll: referencesToClassName ].
>>>
>>> ].
>>>
>>> references notEmpty ifTrue: [ self signalCanNotRemove:
>>> aClassToSafelyRemove dueToReferences: references toAll: referenced ].
>>> --------
>>> If you save it and answer to declare as method temp referencesToName
>>> and referencedByName, and to define as
>>> block-temp referencesToVariableBinding and referencesToClassName, the
>>> debugger popups because #+ is sent to a BlockNode
>>> Can you take a look at it? I did not have time to see it, but it is
>>> really weird because tempsMark is returning a BlockNode instead of an
>>> integer...
>>> I verified that this is a new error added by the changes you made.
>>>
>>> Thanks!
>>>
>>> --
>>>
>>> *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
>>>
>>

-- 

*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/20191222/59710094/attachment.htm>


More information about the Cuis-dev mailing list