✗
Failing This test is currently failing.
Failed: frontend
Failure Output
error[PARSE003]: single continuation branch 'final' carrying a payload is a one-variant tag union — declare the single output as a bare return instead: `-> <type>`
--> tests/regression/300_ADVANCED_FEATURES/370_VARIANTS/8215_subflow_variant_with_continuations/input.kz:15:1
|
15 | ~event greet { value: i32 }
| ^ Code
// Test 8215: Subflow variant with continuations.
//
// Shape: `~event|variant = invocation(args) | branch binding |> result_constructor`
// Combines the variant-arm declaration (new, established by 8213/8214) with
// the subflow-with-continuations shape from 302_subflow_flow (grounded passing test).
//
// Currently expected to trip the @compileError marker in visitor_emitter.zig
// because the variant emission loop only handles continuations.len == 0.
~import std/io
~import std/build
const std = @import("std");
~event greet { value: i32 }
| final i32
// Two helper events with proc bodies, copied from 302_subflow_flow.
~event double { value: i32 } -> i32
~proc double|zig {
return value * 2;
}
~event identity { value: i32 } -> i32
~proc identity|zig {
return value;
}
// Default unvariant arm — passes value through.
~greet = identity(value): r => final r
// Variant arm — doubles. Same shape as the default arm but |two-tagged.
~greet|two = double(value): r => final r
// Register the |two variant.
~std/build:variants {
"input:greet": "two"
}
| configured _ |> _
| skipped _ |> _
| invalid-event _ |> _
~event print-result { value: i32 }
~proc print-result|zig {
std.debug.print("{}\n", .{value});
}
// Expected: greet(value: 21) picks |two variant → double(21) → 42 → print 42.
~greet(value: 21)
| final f |> print-result(value: f)
Expected output
42
Flows
subflow ~greet click a branch to expand · @labels scroll to their anchor
identity (value)
subflow ~greet click a branch to expand · @labels scroll to their anchor
double (value)
flow ~variants click a branch to expand · @labels scroll to their anchor
variants (source: "input:greet": "two")
flow ~greet click a branch to expand · @labels scroll to their anchor
greet (value: 21)
Test Configuration
MUST_RUN