cli: restrict source scope names to lexical task operands

This commit is contained in:
dev committed 2026-10-07 19:50:49 +03:00
1 parent 364eb57bbc
commit 9001e56325
32 files changed
+307 -6

No files matched your search

@@ -0,0 +1,21 @@
// expect: run
// result: 42
// schedules: 8
// phase: 6
// spec: docs/spec/15-source-language.md §7
module scope_cases.nested_same_name
fn work(x: u64) -> u64 effects [] { x }
fn main() -> u64 effects [task.spawn, task.wait] {
var total: u64 = 0;
scope s {
let first = task.spawn(s, work, 20u64);
scope s {
let second = task.spawn(s, work, 22u64);
let s = 0u64;
total = task.join(move second) + s;
}
total = total + task.join(move first);
}
total
}