✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
output_emitted.zig:45:55: error: type 'i32' does not support struct initialization syntax
Failure Output
Showing last 10 of 11 lines
Error: output_emitted.zig:45:55: error: type 'i32' does not support struct initialization syntax
.done => |d| .{ .done = .{ .result = d.result } },
~^~~~~~~
referenced by:
flow0: output_emitted.zig:51:57
main: output_emitted.zig:169:22
4 reference(s) hidden; use '-freference-trace=6' to see all references
output_emitted.zig:53:56: error: type 'i32' does not support field access
@import("std").debug.print("Result: {d}\n", .{d.result});
~^~~~~~~ Code
// Test demonstrates the concept of mixed implementations
// In a real scenario with multiple procs for same event,
// if ANY proc is impure, the event should be marked impure
~import "$std/io"
const std = @import("std");
// Pure event
~event pure_op { x: i32 }
| done i32
~[pure]proc pure_op {
return .{ .done = x * 2 };
}
// Impure event
~event impure_op { x: i32 }
| done i32
~proc impure_op {
std.debug.print("[IMPURE] Processing {}\n", .{x});
return .{ .done = x * 2 };
}
// Flow that composes impure operations
// Demonstrates that purity is per-event: if any callee is impure, the flow is impure
~event mixed { x: i32 }
| done i32
~mixed = impure_op(x: x)
| done d |> done { result: d.result }
~mixed(x: 21)
| done d |> std.io:print.ln("Result: {{ d.result:d }}")
Expected
[IMPURE] Processing 21
Result: 42
Test Configuration
MUST_RUN