make record fields resolve type-factory calls before runtime validation

This commit is contained in:
2026-07-20 15:49:52 +02:00
parent ec36b6b861
commit 05aa7d084a
5 changed files with 76 additions and 12 deletions
+5 -1
View File
@@ -2176,7 +2176,11 @@ parse_if :: proc(parser: ^Parser) -> ast.Stmt_Id {
else_body: []ast.Stmt_Id = nil
saved_cursor := parser.cursor
skip_newlines(parser)
if current(parser).kind == .Keyword_Else {
// `else:` (and the reserved `else |...|:` shape) starts the next match arm;
// it is not the else-branch of a brace-less if used as the previous arm body.
match_arm_else := current(parser).kind == .Keyword_Else &&
(peek(parser).kind == .Colon || peek(parser).kind == .Pipe)
if current(parser).kind == .Keyword_Else && !match_arm_else {
advance(parser)
skip_newlines(parser)
if current(parser).kind == .Keyword_If {