[squeak-dev] CompiledMethodTest >> #testMethodClass

Frank Shearar frank.shearar at gmail.com
Sat Jan 11 12:15:06 UTC 2014


On 10 January 2014 20:41, Colin Putney <colin at wiresong.com> wrote:
>
>
>
> On Fri, Jan 10, 2014 at 4:56 AM, Frank Shearar <frank.shearar at gmail.com>
> wrote:
>>
>> This fails because the CompiledMethod from a removed class returns nil
>> for its #methodClass.
>>
>> The test implies that an orphaned method will still know its removed
>> class.
>>
>> However, Environment >> #forgetClass:logged: clearly nils out the
>> binding of a removed class:
>>
>>     "snip other stuff"
>>     undeclared declare: aClass name from: declarations.
>>     declarations removeKey: aClass name ifAbsent: [].
>>     [undeclared at: aClass name put: nil]
>>         on: AttemptToWriteReadOnlyGlobal
>>         do: [:n | n resume: true].
>>     self binding: binding removedFrom: self]
>>
>> So is this just an API change? Should the test be updated, or is this a
>> bug?
>
>
> It's not an API change, because SystemDictionary>>forgetClass:logged: does
> the same thing. But I don't know if the test is right.

In which case the test was passing by accident, until relatively
recently: this used to pass, back in the day.

frank


More information about the Squeak-dev mailing list