Improve error message when indexing a function
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=5423
Reported by Martin Stjernholm mast@roxen.com
Consider:
object x() {...}
void foo()
{
x->bar();
}
Here the function call parens for x were accidentally left out. The compiler reports the attempt to index the function like this:
/home/mast/foo.pike:4:Indexing on illegal type.
/home/mast/foo.pike:4:Got : string(0..255).
This message doesn't say what was being indexed, and if macros are involved it might not be trivial to find out. The compiler ought to say something like "Cannot index a function" instead.