You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A syntax error in a stdlib file surfaces as cascading prelude type errors #165
Writing if cond do a else b end (the do form, which the parser rejects in favour of then) inside a block in src/stdlib/string.kex did not produce the syntax error the same code produces in a user file. Instead the make String block was silently cut short at that point and the prelude interface check reported a wall of unrelated nonsense:
error: prelude interface: src/stdlib/time.kex:141:23: `at` expects argument 1 to be Range, but got String
error: prelude interface: src/stdlib/time.kex:145:29: `replace` expects 2 argument(s), got 3
error: prelude interface: src/stdlib/parsing.kex:28:36: `count` expects argument 1 to be Range, but got String
...
Every one of those is a String method that had vanished from the truncated make String block. Nothing pointed at string.kex at all, and the actual message ("use 'then' instead of 'do' in if expression") only appeared after extracting the function into a scratch .kex file.
Two things to look at:
the parser recovering from that error by consuming the enclosing end, so the rest of a make block is dropped instead of the error being reported;
the prelude build reporting downstream type errors when the stdlib source it just parsed produced diagnostics — those should be surfaced first and abort.
Fixed in #396: the prelude build reports stdlib parse errors first (naming the file) and aborts before analysis, and if ... do is reported once and parsed as then, so it no longer consumes the enclosing block's end. Regression: spec/error_if_with_do_in_make.kex.
Activity
akoskovacs commentedon Sep 24, 2026
Fixed in #396: the prelude build reports stdlib parse errors first (naming the file) and aborts before analysis, and
if ... dois reported once and parsed asthen, so it no longer consumes the enclosing block'send. Regression:spec/error_if_with_do_in_make.kex.