On 10 Aug 2018, at 23:16, Tim Mackinnon <tim@testit.works> wrote:
Actually I think I figured that bit out - a bit clumsily - (pointers appreciated)
createMissingClassActionFor: aMessage in: aContext |errorNode senderContext newClass variableNode | senderContext := aContext sender. errorNode := senderContext method sourceNodeExecutedForPC: senderContext pc. variableNode := errorNode receiver receiver.
newClass := OCUndeclaredVariableWarning new node: variableNode; defineClass: variableNode name. aContext restart.
However that last line is wrong, as it doesnât restart with my newly defined class - I also tried
aContext restartWithNewReceiver: newClass
But again, I get a debugger where my class is still bound to nil. So whatâs the trick to re-evaluate with the new class Iâve created? Or maybe Iâm totally on the wrong track (still its very interestingâ¦)
what is a bit bad is that you catch the problem âtoo lateâ (that is, the DNU to nil, not the read of nil), so nil is already pushed on the stack at this point. I tried it in the inspector and at least the class binding was correct after defining the class⦠do you have an image with the whole code to try? Marcus