The parser fails at the first brace of the record in the then branch:
s = List.walk chunks {lastBiggest : 0, current: 0} \state, elem ->
num = Str.toNat elem
if (Result.isOk num) then
{ state & current: (state.current + (Result.withDefault num crash)) }
else
{ lastBiggest: state.current, current: 0 }
Is there a syntax error?
Oh, okay, when I replace the crash
by a number it works. Not sure if there should be an error here :thinking:
crash is a statement, not an expression
but if the error did not make that clear, that is a bug
I think at some point we talked about giving explicit warnings about crash
being used in an argument position :thinking:
because it can't work, but it looks like it might!
Last updated: Jul 06 2025 at 12:14 UTC