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
Sema: a generator value used after g |> stage(...) consumed it is accepted (use after move not reported) #1741
Spec: §13.4 ("A generator value is consumed once"), §2.2 (use of a moved value is an error). Found on branch gen-push-pull (#1725); reproduces on the gen-push-impl base.
Repro:
use std.generators.{take, collect}
gen fn words(all: Vec[str]) -> str:
for s in all:
yield s
fn main:
let g = words(["a".clone(), "b".clone()])
let v = g |> take(1) |> collect()
print(v.len())
for x in g:
print(x)
Expected: error: use of moved value at for x in g. Actual: compiles; prints 1 and the loop runs over the moved-out (blanked) value — nothing, no double free under --debug-alloc.
The direct call take(g, 1) and (on gen-push-pull) g.pull() report the move. The pipeline path (check_generic_pipeline_call, SemaCheck.w) calls check_generic_call with the left-hand side as argument 0 but never marks it moved; the generic free-call path in check_call marks every by-value argument moved (mark_moved_if_consumed) when the callee has no signature yet.
Activity
D69: g.pull() — a generator stepped by next() on its own fiber (§13.4, …
D69: g.pull() — a generator stepped by next() on its own fiber (§13.4, …
D69: g.pull() — a generator stepped by next() on its own fiber (§13.4, …
D69: g.pull() — a generator stepped by next() on its own fiber (§13.4, …
D69: g.pull() — a generator stepped by next() on its own fiber (§13.4, …
D69: g.pull() — a generator stepped by next() on its own fiber (#1748)
Sema: a pipeline stage consumes its by-value arguments like the direc…
Type checker: D74 entry sources and chain moves, field-view bindings (#…