✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: an unnamed `|>` at a step's own level after that step's arms is the
// join (400_210), and arm bindings are arm-local — `t` bound by `| img t`
// is invisible at the join. `t` sits inside std/io's `{{ }}` interpolation,
// which the core flow checker does not read (KORU108 covers core call
// arguments only), so today the refusal is the host's `use of undeclared
// identifier 't'`.
import std/io
pub tor load { n: i64 }
| img i64
| err i64
load = if(n < 0)
| then => err n
| else => img n
std/io:print.ln("start")
|> load(n: 3)
| img t |> std/io:print.ln("img {{ t:d }}")
| err e |> std/io:print.ln("err {{ e:d }}")
|> std/io:print.ln("join {{ t:d }}")
Actual compiler output
Error: output_emitted.zig:151:959: error: use of undeclared identifier 't'
(struct { fn __kout(__fd: i32, __b: []const u8) void { if (@import("builtin").os.tag == .freestanding) { const __kc = struct { extern var stdout: ?*anyopaque; extern var stderr: ?*anyopaque; extern fn fputs(__s: [*:0]const u8, __st: ?*anyopaque) c_int; }; var __kt: [4096]u8 = undefined; for (0..(__b.len + __kt.len - 2) / (__kt.len - 1)) |__ki_2| { const __kn = @min(__kt.len - 1, __b.len - __ki_2 * (__kt.len - 1)); @memcpy(__kt[0..__kn], __b[__ki_2 * (__kt.len - 1)..][0..__kn]); __kt[__kn] = 0; @import("std").mem.doNotOptimizeAway(__kc.fputs(@as([*:0]const u8, @ptrCast(&__kt)), if (__fd == 2) __kc.stderr else __kc.stdout)); } } else { @import("std").mem.doNotOptimizeAway(@import("std").posix.write(__fd, __b) catch @as(usize, 0)); } } fn __kw(comptime __f: []const u8, __a: anytype) void { var __kb: [65536]u8 = undefined; const __ks = @import("std").fmt.bufPrint(&__kb, __f, __a) catch __kb[0..0]; __kout(1, __ks); } }).__kw("join {d}\n", .{t});
^Must fail at backend compile:
Code generation must reject the program.
Error output must contain
use of undeclared identifier 't'Flows
subflow ~load click a branch to expand · @labels scroll to their anchor
if (n < 0)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "start")
Test Configuration
MUST_ERROR