✓
Passing This code compiles and runs correctly.
Code
// `$mod.` interpolates in a plain HOST-LINE `fn`, not only inside a
// `proc` body. Ruled by Lars 2026-08-07: "I think probably $mod should
// also interpolate in the hostlines. It feels very likely."
//
// The pin: a `fn` beside a `proc` in the same module reaches module state
// by the SAME spelling — `$mod.counter` in `bump` below must land as bare
// `counter` in the emitted container, exactly as the proc body's does.
// Before the interpolation reached host lines, the token survived
// verbatim and the build died with `expected statement, found 'invalid
// token'` — a diagnostic naming generated code, implicating no line the
// author wrote.
~import std/io
const std = @import("std");
var counter: i64 = 40;
// The plain host-line fn. `$mod.counter` here is the whole point of the test.
fn bump(by: i64) void {
$mod.counter += by;
}
~pub tor run {} -> i64
~proc run|zig {
bump(2);
return $mod.counter;
}
~run(): n |> std/io:print.ln("counter={{ n:d }}")
Actual
counter=42
Expected output
counter=42
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN