You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
t27b: an untyped var set to an integer literal takes the reference's u32/u64 width; an untyped undefined const is accepted (StmtLocal) #6967
Refs #6063 (coverage lane 1, family StmtLocal, rank 4 in tri t27b next on lab run 62e27a1; ranks 1-3 are lane 2's #6866 / #6961 and lane 1's #6965)
Problem
t27b refuses two shapes of untyped local that the reference compiles and runs:
var i = 0; is refused as "var i initialised with an untyped integer needs a type". The reference's gen-zig (zig_int_literal_default_type in bootstrap/src/compiler.rs) pins the width: var i: u32 = 0;. It uses u64 when the literal does not fit u32, and a literal suffix wins. This applies only when the initializer is a bare integer literal. var x = -1, var x = 0.0 and var n = N stay untyped, and Zig refuses them.
const _config = undefined; is refused as "_config has neither type nor value". The reference prints it as it is, plus _ = _config; when nothing reads it, and Zig accepts it.
These shapes alone block two files that the reference passes:
specs/tri/t27b/conformance/untyped_local.t27 gives 6 tests: 6 pass under t27c test-report on the lab, with 13 runtime asserts and 0 vacuous. Wrapping arithmetic (0 -% 1 == 4294967295) makes the u32 / u64 choice observable.
Plan
In cli/t27b/src/lower.rslocal_with:
An untyped var whose initializer is a bare integer literal takes the reference's width, as if it had been declared with that type.
An untyped const set to undefined binds nothing, so a read of it is still refused.
Everything else stays refused as StmtLocal.
Owner approval
The owner put the label owner-approved-foreign on epic #6063 ("add the label yourself and do the work", translated). The Rust edit is minimal and is listed in tools/policy/foreign-exceptions.txt.
Activity
t27b untyped_local: a typed module const is not an untyped-literal ca…
t27b: ledger and NOW entry for the untyped local (Closes #6967)
Merge origin/master into claude/t27b-lane1-redeclare (Closes #6967)
t27b: an untyped var takes the reference's u32/u64 width; an untyped …
feat(t27b): std.mem.eql/indexOf on byte slices and byte-array pointers (
fix(codegen): gen-rust enum order and gen-zig float-call cast (#6941) (…