mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
Not all of them are improvements, sometimes the runtime error can give better context than the static type error. I need to edit the type expectation machinery to allow a _reason_ for the expectation, but we can do that at some later time. For now let's get all the tests to pass.
44 lines
1,005 B
Text
44 lines
1,005 B
Text
// Even with a limit on the depth of function calls, if every call causes a very
|
|
// deep stack frame, for example due to naively evaluating unary operators, we
|
|
// can still overflow the native stack.
|
|
let f = f => {{f(f).x}.x.c};
|
|
f(f)
|
|
|
|
# output:
|
|
stdin:4:16
|
|
╷
|
|
4 │ let f = f => {{f(f).x}.x.c};
|
|
╵ ^~~~
|
|
Error: Evaluation budget exceeded. This expression exceeds the maximum evaluation depth of 150.
|
|
|
|
stdin:4:17
|
|
╷
|
|
4 │ let f = f => {{f(f).x}.x.c};
|
|
╵ ^
|
|
In call to function.
|
|
|
|
stdin:4:17
|
|
╷
|
|
4 │ let f = f => {{f(f).x}.x.c};
|
|
╵ ^
|
|
In call to function.
|
|
|
|
stdin:4:17
|
|
╷
|
|
4 │ let f = f => {{f(f).x}.x.c};
|
|
╵ ^
|
|
In call to function.
|
|
|
|
stdin:4:17
|
|
╷
|
|
4 │ let f = f => {{f(f).x}.x.c};
|
|
╵ ^
|
|
In call to function.
|
|
|
|
stdin:4:17
|
|
╷
|
|
4 │ let f = f => {{f(f).x}.x.c};
|
|
╵ ^
|
|
In call to function.
|
|
|
|
Note: The call stack is too deep to display in full. Only the innermost calls are shown above.
|