Smalltalk self issue

46 Views Asked by At

I'm running into this error: "[basicNew] Super and Self Messages sent but not implemented"

new: dice ^self basicNew setRoll: dice

I can't seem to figure out what I need to do? This is first time working with smalltalk

1

There are 1 best solutions below

0
James Foster On

Which dialect of Smalltalk (Pharo, VW, VA, Dolphin, GemStone, ...)? Can you show how you got to the error (where did you type the code you provided)? Is there more detail on the error (like a stack)?

The error suggests that the 'basicNew' message is sent but not implemented. My suspicion is that you defined this method on the "instance side" rather than the "class side" (more details here). That is, you should be sending the 'new' and 'basicNew' messages to a class (Game new) and your code should be added to the "class side" of the class (and how this is done will depend on your dialect and IDE).