Ciao,
i work to port some code from Pharo 4.0 to Pharo 6.1-64. My root class into Pharo 4.0 define the properties instance variable and some relative method: a) propertyAt: aKey ifAbsent: aBlock ^ self properties at: aKey ifAbsent: aBlock b) propertyAt: aKey ifAbsentPut: aBlock ^ self properties at: aKey ifAbsentPut: aBlock c) propertyAt: aKey put: aValue ^ self properties at: aKey put: aValue d)...... Now when i port this code into the Pharo 6.1-64 when compile the code the Behavior originalName method implement: ^ (( self isObsolete and:[ self name beginsWith: 'AnObsolete ............ where isObsolete TClass is: self propertyAt: #obsolete ifAbsent: false But my class implement a specific propertyAt: ifAbsent: method and the system generates errors and don't compile the code. Thank you for every consideration. Dario |
I wrong....... the error is relative to my root class ... For this class i implemented the class method propertyAt: aKey ifAbsent: aBlock This is in conflict with : ^ (( self isObsolete and:[ self name beginsWith: 'AnObsolete ............ where isObsolete TClass is: self propertyAt: #obsolete ifAbsent: false Thanks for considerations, Dario
|
Hi Dario, Have you defined those methods in the class side? a) propertyAt: aKey ifAbsent: aBlock I will let Marcus answer more properly but I think you should rename those methods to not collapse with the behaviour in the base class...
|
Yes, we added a general property API to classes. This is used for e.g. tagging classes when they are obsolete (instead of relying in the name). It can be used for other things, too. (the same as we have a property API on CompiledMethod, first class Variables and AST Nodes). Marcus |
Free forum by Nabble | Edit this page |