027 capture basic

✓ Passing This code compiles and runs correctly.

Code

// Test: Basic ~capture as top-level flow

~import "$std/io"
~import "$std/control"

const std = @import("std");

// Simple test helper to print an integer
~event print_int { value: i32 }

~proc print_int {
    std.debug.print("{d}\n", .{value});
}

// Struct capture with typed init
~capture(expr: { total: @as(i32, 0) })
| as |> captured { total: 42 }
| captured final |> print_int(value: final.total)
input.kz

Expected Output

42

Test Configuration

MUST_RUN