✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// VERIFIED REGRESSION TEST - DO NOT MODIFY WITHOUT DISCUSSION
// ============================================================================
// Test: Chained subflows (subflow calling subflow)
// Feature: Subflow A calls Event B, where B is implemented by Subflow C
// Verifies: Subflow composition works - subflows can call other subflows
// ============================================================================
const std = @import("std");
~import std/io
// Base proc: adds 5 to a number
~event add-five { value: i32 }
| result i32
~proc add-five|zig {
return .{ .result = value + 5 };
}
// Event that will be implemented as a subflow
~event double { value: i32 }
| result i32
// Subflow 1: double calls add-five and passes through the result
~double = add-five(value)
| result r => result r
// Event that will call the subflow
~event process { input: i32 }
| final i32
// Subflow 2: process calls double (which is itself a subflow)
~process = double(value: input)
| result r => final r
// Helper to print i32
~event print-result { value: i32 }
~proc print-result|zig {
std.debug.print("{}\n", .{value});
}
// Test: 21 + 5 = 26
// Chain: process (subflow) → double (subflow) → add-five (proc)
// This tests that a subflow can call another subflow successfully
~process(input: 21)
| final f |> print-result(value: f)Actual
26
Expected output
26Test Configuration
MUST_RUN