✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
output_emitted.zig:63:18: error: expected type 'i32', found '@Type(.enum_literal)'
Failure Output
🎯 Compiler coordination: Passes: 20 (flow-based: elaborate, analysis, emission)
Error: output_emitted.zig:63:18: error: expected type 'i32', found '@Type(.enum_literal)'
.finished => |f| {
~^~~~~~~~
referenced by:
handler [inlined]: output_emitted.zig:52:39
flow0: output_emitted.zig:158:49
4 reference(s) hidden; use '-freference-trace=6' to see all references Code
// Abstract events: `~[abstract]` declares a signature; a `~proc` in the same
// file is an optional default implementation; `~module:event = ...` provides
// THE implementation. Within an implementation, calling the event name
// delegates to the default. Resolved at compile time — no runtime dispatch.
const std = @import("std");
// Example 1: Abstract event WITH default implementation
// The default can be called from within implementation via delegation
~[abstract] tor coordinate { ctx: i32 } -> i32
~proc coordinate|zig {
std.debug.print("Default coordination: {}\n", .{ctx});
return ctx;
}
// Example 2: Abstract event WITHOUT default implementation
// User MUST provide implementation or compile error
~[abstract] tor process { data: i32 } -> i32
// Helper proc for Example 4
~tor double { value: i32 } -> i32
~proc double|zig {
return value * 2;
}
// Example 3: Implementation that delegates to default and extends
// The module qualifier (input:) marks this as an impl override
// Module name is derived from filename: input.kz -> "input"
~input:coordinate =
coordinate(ctx: 42) // Delegates to default
| finished f -> f + 1
// Example 4: Implementation that provides complete logic
// No delegation to default (there isn't one for 'process')
~input:process =
double(value: data)
| result r -> r
// Use the implemented events
~coordinate(ctx: 10)
~process(data: 5)
Expected output
Default coordination: 42
Flows
subflow ~coordinate click a branch to expand · @labels scroll to their anchor
coordinate (ctx: 42)
subflow ~process click a branch to expand · @labels scroll to their anchor
double (value: data)
flow ~coordinate click a branch to expand · @labels scroll to their anchor
coordinate (ctx: 10)
flow ~process click a branch to expand · @labels scroll to their anchor
process (data: 5)
Test Configuration
MUST_RUN