pyret-lang icon indicating copy to clipboard operation
pyret-lang copied to clipboard

confusing error message for table.row-n(-1)

Open kenichi-asai opened this issue 4 years ago • 2 comments

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.

kenichi-asai avatar May 14 '21 08:05 kenichi-asai

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.".

kenichi-asai avatar May 14 '21 09:05 kenichi-asai

Hey @jpolitz @blerner @jswrenn not sure if you saw these.

shriram avatar May 23 '21 00:05 shriram

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.) image

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.

blerner avatar May 03 '24 18:05 blerner