Open Trivernis opened 9 months ago
Thanks for reporting this @Trivernis :)
Some extra data; this happens during the building of the app, not during the execution:
$ roc build main.roc
thread '<unknown>' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)
I think I might have run into this, here is a one-liner that gets a similar error message:
four = \_ -> (((((\f -> \x -> f (f x))(\f -> \x -> f (f x))))(\x -> x + 1))(0))
Defining this function in the REPL is enough to cause a stack overflow and crash it.
This example also doesn't involve any recursion, so it rules that out.
EDIT: For another example, the Y combinator doesn't give a type error like you'd expect, defining it (y = \f -> (\x -> f (x x)) (\x -> f (x x))
) instead causes a stack overflow to happen
When trying to compile this program that binds one parameter to a function, composes that function with itself and then uses List.map to call both the bound function and the composed function the build fails with a stack overflow error. This happens when building it in dev mode too. Also querying the language server for the signature of any of the elements involved crashes it.
Version:
roc nightly pre-release, built from commit dd86b11 on Di 30 Jan 2024 09:01:54 UTC
Target: x86_64 LinuxLLDB if that's helpful