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
for r in s over a str passes check and fails MIR lowering (NK_FOR) #1828
for over a str type-checks and then fails MIR lowering — Sema accepts what MIR cannot lower (found building the #1819 matrix).
fn main:
let s = "ab" ++ "cd"
for r in s:
print(f"{r}")
with check: ok. with run:
error: MIR lowering failed for function 'main' in strfor.w; AST codegen was removed, so this function cannot be compiled
WITH_MIR_AUDIT=1 names the node: [mir-lower-fail] kind=37 fn=main (NK_FOR).
The spec (docs/spec/strings.md, iteration.md) defines no iteration over str. Expected: Sema refuses the loop with a diagnostic (or, if Eric rules iteration over a str in, MIR lowers it) — post-Sema invalid MIR is a compiler bug either way (D65).
Activity
Sema/MIR: for over a non-iterable is refused; one-clause for over Opt…
c_import/migrate/emit-c: no `-> Unit` on void C fns (#1838); header f…