pyret-lang
pyret-lang copied to clipboard
confusing error message for table.row-n(-1)
For the following program:
table = table: field1, field2
end
table.row-n(-1)
Pyret's error message reads:
Evaluating this expression errored:
table.row-n(-1)
It was expected to produce a "NumNonNegative", but it produced a non-"NumNonNegative" value:
-1
where table.row-n(-1) is highlighted. Naturally, we interpret "It" to refer to the highlighted expression, but "It" really refers to -1.
Maybe related to this is:
table = table: field1, field2
end
table.row-n("a")
for which I got "One or more internal errors prevented us from showing the best error message possible. Please report this as a bug.".
Hey @jpolitz @blerner @jswrenn not sure if you saw these.
Well, there's good news and bad news. The good news is, I can fix the -1 error message so it matches the "a" error message. (I'll also fix a similar issue in column-n while I'm at it.)
The bad news is we also have to figure out how to fix #1658 to get the error messages to render fully properly, and that bug seems to be really hard.