Phase 8.1: ! (unwrap/panic) operator — syntax, parsing, HIR lowering, runtime panic

This commit is contained in:
2026-05-31 13:45:55 +03:00
parent 3949a2f91e
commit 98d1354b7a
7 changed files with 59 additions and 0 deletions
+4
View File
@@ -734,6 +734,10 @@ proc checkExpr(sema: var Sema, expr: Expr, scope: Scope): Type =
# For now, assume Result<int, String> -> int
# TODO: check operand is Result/Option and current function returns same type
return makeInt()
of ekUnwrap:
let operandType = sema.checkExpr(expr.exprUnwrapOperand, scope)
# Unwrap: extract Ok value or panic on Err
return makeInt()
of ekBlock:
var blockScope = newScope(scope)
var lastType = makeVoid()