astgen: catch error capture, @panic, @errorName, @field, larger block scopes
- Add error capture scope to orelseCatchExpr (catch |err| now creates a ScopeLocalVal for the captured error variable) - Add @panic, @errorName, @field builtins - Increase blockExprStmts scope arrays from 64 to 128 entries (build.zig has 93 var decls in a single block) corpus build.zig still skipped: needs switchExprErrUnion optimization (catch |err| switch(err) pattern). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -793,6 +793,9 @@ test "astgen: corpus test_all.zig" {
|
||||
}
|
||||
|
||||
test "astgen: corpus build.zig" {
|
||||
// TODO: 6 extra instructions — missing switchExprErrUnion optimization
|
||||
// (catch |err| switch(err) pattern emits SWITCH_BLOCK instead of
|
||||
// SWITCH_BLOCK_ERR_UNION).
|
||||
if (true) return error.SkipZigTest;
|
||||
const gpa = std.testing.allocator;
|
||||
try corpusCheck(gpa, @embedFile("../build.zig"));
|
||||
|
||||
Reference in New Issue
Block a user