[Cuis-dev] Error when declaring undef. temp var
Hernan Wilkinson
hernan.wilkinson at 10pines.com
Fri Dec 20 09:29:22 PST 2019
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191220/bf643493/attachment.htm>
More information about the Cuis-dev
mailing list