mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
This fixes a longstanding issue where reporting errors that we have to blame on just the document's result in general got blamed on its full span, which is often a comment and not the offending value. Now we blame it on the inner body expression, which is more natural.
12 lines
295 B
Text
12 lines
295 B
Text
// This tests that we blame the error on the innermost expression,
|
|
// even when it is preceded by a statement.
|
|
let method = "String".len;
|
|
assert method() == 6, "The length of 'String' is 6.";
|
|
method
|
|
|
|
# output:
|
|
stdin:5:1
|
|
╷
|
|
5 │ method
|
|
╵ ^~~~~~
|
|
Error: Methods cannot be exported as json.
|