Join GitHub today
sending at:put: to an undefined object (nil) give confusing error message #2795
If you forget to initialise a variable you thought was a Dictionary - you get a confusing error message: "Error: only integers should be used as indices"
This is a consequence of having at:put: defined on Object (which is a bit nasty)
Should UndefinedObject at least override this and signal something a bit more obvious? This is a common easily done thing and we don't support it very well.
I just did it in some code, and was scratching my head initially until I read the stack properly and realised it was something much simpler than I thought I had done.
From ML: Richard gives a nice test scenario:
I understand #basicAt:[put:] being in Object, but I never understood #at:[put:] being there.
In my Smalltalk, you get a DNU.
In Squeak you get a debugger window with title
In VW you get a "Subscript out of bounds" error, which is disappointing,