subflow flow

✓ Passing This code compiles and runs correctly.

Code

// ============================================================================
// VERIFIED REGRESSION TEST - DO NOT MODIFY WITHOUT DISCUSSION
// ============================================================================
// Test: Flow-based subflow calling another event
// Feature: ~event_name = other_event(args) | branch |> result { fields }
// Verifies: Subflow can invoke events and map their outputs
// ============================================================================

const std = @import("std");

~import "$std/io"

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

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

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

// Subflow: calls double and maps its output
~process = double(value: input)
| result r |> final r

// Helper to print i32
~event print_result { value: i32 }
| done

~proc print_result {
    std.debug.print("{}\n", .{value});
    return .{ .done = .{} };
}

// Test: 21 * 2 = 42
~process(input: 21)
| final f |> print_result(value: f)
    | done |> _
input.kz

Expected

42

Actual

42

Test Configuration

MUST_RUN