✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// TEST: Proc Inline Flow Expressions (CURRENTLY BROKEN)
// ============================================================================
// Purpose: Document that proc inline flows SHOULD accept complex expressions
//
// Design Decision:
// - Procs generate Zig code, so they can compute
// - Inline flows are just syntactic sugar for helper functions
// - Expressions like `value * 2` should work in proc branch constructors
//
// THE BUG:
// - Parser correctly sets .expression_str = "value * 2"
// - Serializer writes it to backend.zig correctly
// - Backend.zig contains the string literal
// - But at RUNTIME, bootstrap sees expression_str as NULL
// - Falls through to use .type = "auto", generating invalid code
//
// WORKAROUND:
// - Use subflow syntax for field access (no arithmetic)
// - Or use full proc body with local variables
// ============================================================================
const std = @import("std");
~event double { value: i32 }
| result { doubled: i32 }
// This SHOULD work: arithmetic expressions allowed in proc inline flows
~proc double = result { doubled: value * 2 }
pub fn main() void {
const result = double_event.handler(.{ .value = 21 });
std.debug.print("Doubled: {}\n", .{result.result.doubled});
}
Test Configuration
MUST_RUN