Open olwmc opened 2 years ago
Yes! Actually even better,
Error: <path>: 2: none of the function bodies unified with actual parameters
foo "string!".
.....^
where it points to the offending token or structure.
I really don't like that error message, only folks who know about our semantics can understand that message. What would be a could general error message to post here? Something like,
Error: <path>: 2: actual argument not recognized.
foo "string!".
.....^
Any other suggestions?
I think that works well! While writing this issue I was thinking the same thing. I'll add it to #126
in 1.1.4 the generated error message reads
lutz$ asteroid loc.ast
traceback (most recent call last):
loc.ast: 1: calling <toplevel>
loc.ast: 6: calling foo
error: loc.ast: 2: actual argument 'string!' not recognized by function 'foo'
lutz$
which is an improvement.
However, because recognizing an actual argument is pattern matching and therefore computation the error message is pointing into the function code rather than to the call site. Should we fix that?
Consider the program:
Running this would return the error
Error: <path>: 2: none of the function bodies unified with actual parameters
A nicer way of displaying errors would be something like this: