I have a puzzling situation. I have an object that has routine on it named HandleEvent. I also have a routine named HandleEvent that’s not on an object.
It seems that’s not acceptable to Inform as I get the error
Error: Expected routine name but found HandleEvent
If I rename the non-object routine to something else (e.g. ProcessEvent), the error disappears.
Is this really not allowed in Inform or have I misunderstood the cause of the error?
then HandleEvent is defined as a property ID. It’s not a function. This particular object has a function as its obj.HandleEvent value, but some other object might have a string or something. You can’t call HandleEvent() on its own.
I’ve submitted a change which will generate this error:
line 9: Error: “HandleEvent” is a name already in use and may not be used as a routine name too (Individual property “HandleEvent” was defined at line 6)
Or, depending on what order you put things in, you might get:
line 9: Error: “HandleEvent” is a name already in use and may not be used as a property name too (Routine “HandleEvent” was defined at line 6)
(The compiler already had one of these set up, turns out. I added the other case. I also set up the same error when defining attributes, globals, arrays, objects, and classes.)