✓
Passing This code compiles and runs correctly.
Code
// Test: Struct declared via ~struct used as event parameter type
//
// This is the real payoff: declare a type through Koru,
// then use it in event signatures and flows.
~import std/types
~import std/io
// Declare the type through Koru
~struct(Player) {
name: []const u8,
health: i32,
}
// Use it in an event signature
~event greet { player: Player } -> []const u8
~proc greet|zig {
return player.name;
}
// Use it in a flow
const p = Player{ .name = "Alice", .health = 100 };
~greet(player: p): msg |> std/io:print.ln("Hello, {{ msg:s }}!")
Actual
Hello, Alice!
Expected output
Hello, Alice!
Flows
flow ~struct click a branch to expand · @labels scroll to their anchor
struct (Player, source: name: []const u8,
health: i32,)
flow ~greet click a branch to expand · @labels scroll to their anchor
greet (player: p)
Test Configuration
MUST_RUN