ObjectMirror setClass:ifFail: does not work
The following class tests the use of setClass:ifFail: (the only other use of this message is in the Past framework, which AFAIK is not used anywhere as of 2011.10.19):
Newspeak3 'Testing' class SetClassTest usingPlatform: platform = ( "Test changing the class of an object via ObjectMirror."| private ObjectMirror = platform mirrors ObjectMirror. |) ( class Class1 = ( "The first class with one slot named x."| x = 1. |) () : () class Class2 = ( "The second class with one slot named y."| y = 2. |) () : ()'as yet unclassified' testOneTwo = ( "Create an instance of Class1 and change its class to Class2." | a aMirror | a:: Class1 new. aMirror:: ObjectMirror reflecting: a. aMirror setClass: Class2 ifFail: [ :ex | halt. ]. ^a. )) : () }}}
Running the above code on 2011.10.19 results in a halt with the ex variable containing #'bad selector'.
The setClass:ifFail: method ultimately invokes <primitive: 115>, which is defined as "SystemDictionary oopsLeft" in the Smalltalk-80 BlueBook with no further explanation on what oopsLeft means.
I could not find a reference of the Squeak-supported primitives online by googling.
This exhausts my capacity to investigate this issue at this time without spending a significant amount of time on learning Newspeak and Squeak internals.