`try f()` (standalone form) now propagates a failable callee's error to the enclosing failable function. E1.4 was split: E1.4a = standalone try (failure target = function-propagation); E1.4b = fallback-target routing + failable-`or` + whole-program SCC for inferred sets + empty-inferred warning. - lowerExpr: `.try_expr` -> lowerTry - lowerTry: (1) try legal only inside a failable fn; (2) the sole failable-operand check (errorChannelOf(inferExprType(operand))); (3) named-caller widening (checkErrorSetSubset at the propagation site); (4) pure-failable lowering — condBr on tag != 0: propagate (run defers + ret the widened tag) vs continue on success - inferExprType: `.try_expr` arm (success type: void for pure-failable) - lowerBinaryOp .or_op: bail loudly on a failable LHS (exprIsFailable); the optional-`or` path is unchanged for non-failable LHS - value-carrying callee/caller `try` bail loudly (pending E2's tuple ABI) Tests: examples/221-try.sx (positive propagation, exit 5), examples/222-try-rejections.sx (3 stable rejections: outside-failable, non-failable operand, named-widening miss; exit 1). Gates: zig build, zig build test, 260/260 examples.
2 lines
2 B
Plaintext
2 lines
2 B
Plaintext
5
|