Hi folks,
I was updating my lecture on Reflection for the Software Design and Evolution
course, and I see now that anonymous classes can no longer be instances of
Behavior but must be instances of Class. If you try to compile a method on an
instance of Behavior, it fails. (basicLocalSelectors is not understood)
Am I missing something?
Cheers,
Oscar
testPrimitiveChangeClassTo
| anonClass browser |
anonClass := Class new. “must be Class, not Behavior"
anonClass superclass: Browser.
anonClass setFormat: Browser format.
browser := Browser new.
browser primitiveChangeClassTo: anonClass new.
anonClass compile: 'thisIsATest ^ 2'.
self assert: browser thisIsATest = 2.
self should: [Browser new thisIsATest]
raise: MessageNotUnderstood.