✓
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
~tor add-five { value: i32 } -> i32
~proc add-five|zig {
return value + 5;
}
// Event that will be implemented as a subflow
~tor double { value: i32 } -> i32
// Subflow 1: double calls add-five and passes through the result
~double = add-five(value): r -> r
// Event that will call the subflow
~tor process { input: i32 } -> i32
// Subflow 2: process calls double (which is itself a subflow)
~process = double(value: input): r -> r
// Helper to print i32
~tor 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): f |> print-result(value: f)Actual
26
Expected output
26Flows
subflow ~double click a branch to expand · @labels scroll to their anchor
add-five (value)
subflow ~process click a branch to expand · @labels scroll to their anchor
double (value: input)
flow ~process click a branch to expand · @labels scroll to their anchor
process (input: 21)
Test Configuration
MUST_RUN