mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
This time I think I got this one right. There is even the possibility to omit the call frame for calls to BuiltinMethod and BuiltinFunction, and then when they get called from a builtin it still works. I initially thought that that would be useful because those call stacks are so verbose and add little value, but now I'm not so sure any more that they add little value, for some errors it *is* helpful to still know the name of the thing being called, even if you already blame the argument span and the function name is right next to it.
23 lines
564 B
Text
23 lines
564 B
Text
// The method String.len is not a valid key selector function, but it does have
|
|
// a name, so it gets mentioned in the error context.
|
|
let f = "ABC".len;
|
|
[1, 2, 3].group_by(f)
|
|
|
|
# output:
|
|
stdin:4:20
|
|
╷
|
|
4 │ [1, 2, 3].group_by(f)
|
|
╵ ^
|
|
Error: Unexpected argument. 'String.len' takes 0 arguments, but got 1.
|
|
|
|
stdin:4:20
|
|
╷
|
|
4 │ [1, 2, 3].group_by(f)
|
|
╵ ^
|
|
In internal call to key selector from 'List.group_by'.
|
|
|
|
stdin:4:19
|
|
╷
|
|
4 │ [1, 2, 3].group_by(f)
|
|
╵ ^
|
|
In call to method 'List.group_by'.
|