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
Codegen: a Vec element read (view) passed to str.slice is a ptr where i64 is expected; with check says ok #2023
Spec: §3.8 / D22 ruling / D27 — xs[i] denotes the element place; a &T materializes T once an owned-value demand is established (an i64 parameter is such a demand).
Minimal repro (new darwin seed nightly-20261003-local-1-c884c1c2a17c and its stage1, main c884c1c):
var ss: Vec[i64] = Vec.new()
ss.push(1)
let s = ss[0]
print("ab".slice(0, s))
Expected: prints a. Actual: with check says ok; with run fails error: wrong argument type actual=ptr expected=i64 fn=main / error: code generation failed. analyze … audit:all (fn-main form): violation: code generation failed during integrated analysis and no earlier violation, so no Sema/MIR audit names the disagreement (a silent tool, per CLAUDE.md).
Matrix:
let s = ss[0] then "ab".slice(0, s) — FAIL (both slice args; Vec[i32] too)
"ab".slice(0, ss[0]) — FAIL
let s: i64 = ss[0] then "ab".slice(0, s) — ok
let s = ss[0] then a user fn take(a: i64) call take(s) — ok
So the builtin str.slice call path does not materialize the element view into its i64 parameters; a user fn call does.
Also: with analyze refuses an implicit-main file (expected declaration at the first top-level statement).
Workaround in tree: tools/wrap_diag_spans.wsplice helper (a user fn with i64 params), whose comment wrongly blamed a frozen seed (#755 class). Remove the helper when this is fixed.
Activity
wrap_diag_spans: the splice helper works around #2023, not a frozen seed
Seed: darwin nightly-20261003-local-1-c884c1c2a17c; drop stale seed w…
Fix #2023: str intrinsic index args are owned i64 demands; MIR valida…