[squeak-dev] Bug in #requiredSelectors?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Bug in #requiredSelectors?

Zulq Alam-2
Is this a bug or am I doing something wrong? The last assertion fails,
i.e. #requiredSelectors does not reflect removal if interest has been
declared.

" Declare interest in String. "
RequiredSelectors current noteInterestOf: DynamicProtocols in: String.

" Prove that the method we're adding isn't already present. "
self assert: (String requiredSelectors includes: #requiredMethod) not.

" Add a method the implies a new required method. "
String compile: 'implyRequired self requiredMethod'.

" Prove that the implied required method is known. "
self assert: (String requiredSelectors includes: #requiredMethod).

" Remove the method. "
String removeSelector: #implyRequired.

" Prove that the required method is no longer implied. "
self assert: (String requiredSelectors includes: #requiredMethod) not.

" Lose interest. "
RequiredSelectors current lostInterest: DynamicProtocols in: String.

It seems like the cache is not being updated.

Thanks,
Zulq.