subflow multi continuation

✓ Passing This code compiles and runs correctly.

Code

// ============================================================================
// VERIFIED REGRESSION TEST - DO NOT MODIFY WITHOUT DISCUSSION
// ============================================================================
// Test: Subflow with multiple chained continuations
// Feature: ~event = first(...) | b1 |> second(...) | b2 |> third(...) | b3 |> result
// Verifies: Subflows can chain multiple invocations through continuation pipelines
// ============================================================================

const std = @import("std");

~import "$std/io"

// Helper event: triples a number
~event triple { value: i32 }
| tripled i32

~proc triple {
    return .{ .tripled = value * 3 };
}

// Helper event: doubles a number
~event double { value: i32 }
| doubled i32

~proc double {
    return .{ .doubled = value * 2 };
}

// Event to test
~event process { input: i32 }
| final i32

// Multi-continuation subflow: chains triple -> double -> final
~process = triple(value: input)
| tripled t |> double(value: t)
    | doubled d |> final d

// Helper to verify and print the result
~event verify_and_print { value: i32 }
| done

~proc verify_and_print {
    if (value == 30) {
        std.debug.print("30\n", .{});
    } else {
        std.debug.print("ERROR: Expected 30, got {}\n", .{value});
    }
    return .{ .done = .{} };
}

// Test: 5 * 3 * 2 = 30
~process(input: 5)
| final f |> verify_and_print(value: f)
    | done |> _
input.kz

Expected

30

Actual

30

Test Configuration

MUST_RUN