Repository navigation
t27b: return undefined in a void fn is a plain return (Closes #7402) - #7442
Merged
Merged
Conversation
In Zig undefined coerced to void is the one void value, so the fn stops there and the caller goes on. Conformance spec first: specs/tri/t27b/conformance/return_undefined_void.t27. In a test block the statement stays refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gen_ring_buffer, gen_rtree, gen_wal and return_undefined_void are added as pass; gen_work_stealing now stops at codegen FnDecl(frame size). Lab corpus against master 05e633d: mismatch 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
October 7, 2026 09:37
This was referenced Oct 7, 2026
Closed
This was referenced Oct 7, 2026
Merged
Merged
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
Closed
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #6063. Closes #7402.
What
Ported specs end a
-> voidfn withreturn undefined;(a deinit that frees nothing, an early exit). In Zigundefinedcoerced tovoidis the one void value, so the statement is a plainreturn;. t27b now lowers it that way instead of refusing it asExprReturn. Inside a test block it stays refused: there the Zig result is an error union, and an undefined one is no value t27b can name.Conformance first
specs/tri/t27b/conformance/return_undefined_void.t27, 4 tests: the work before the statement is kept, the work after it is skipped, in a branch, at the end of a body, and alone in a fn that is called or not. Reference: 4 pass, 0 vacuous. t27b: the same 4.undefined) refused by t27b where the reference passes 0 tests.Disclosed gap
A statement after
return undefined;is unreachable code, which the reference refuses to compile; t27b runs the file. t27b does not check unreachable code in general, so this gap is older than this family; it is not widened here beyond the new statement.Numbers
cargo test -p t27bon the lab: all suites pass.gen_ring_buffer.t27,gen_rtree.t27,gen_wal.t27(blocked -> pass) and the new conformance spec.gen_work_stealing.t27gets pastExprReturnand now stops at codegenFnDecl(frame size)(16448 bytes of local aggregates; the limit is 16384). No file regressed. No interpreter fallback, no skipped tests.docs/reports/t27b_expectations.json): the four files above added as pass, gen_work_stealing -> codegenFnDecl(frame size). Recounted: pass 533 -> 537, pass_vacuous 262, not_pass 25. No duplicate paths.Foreign code
cli/t27b/src/lower.rsandcli/t27b/tests/source.rsare Rust. The owner approved foreign Rust incli/t27bfor #6063 and asked agents to set theowner-approved-foreignlabel themselves ("add the label yourself and do the foreign part", translated). Both files are listed intools/policy/foreign-exceptions.txt.NOW entry:
docs/now/2026-10-07-t27b-return-undefined.md.Foreign-line budget (#7371)
Master's
check_budget()ongit diff --numstat origin/master...HEAD: allowed (exit 0).cli/t27b/src/lower.rs+9,cli/t27b/tests/source.rs+39, total 48 of 80. The Rust test first had 45 lines; therelease-only case was dropped from it becausereturn_undefined_void.t27already checks that shape against the reference (re-run on the lab:return_undefined_in_a_void_fn ... ok).🤖 Generated with Claude Code