✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// Test 510_102: MUST_FAIL — resume body produces a value of the wrong type.
//
// `! ask []const u8 -> []const u8` declares the resume type as a string,
// but the consumer PRODUCES `-> 42` (an integer literal). The synthesized
// Handlers fn declares return type `[]const u8`, so Zig's type-checker
// rejects the wrong-typed return at backend compile.
//
// This locks the invariant: the resume-value path actually routes the
// declared type to the synthesized fn signature, so type mismatches
// are loud rather than silent.
// ============================================================================
~pub event prompt-user { question: []const u8 }
! ask []const u8 -> []const u8
| done []const u8
~proc prompt-user|zig {
const reply = ask(question);
return .{ .done = reply };
}
~prompt-user(question: "?")
! ask _ -> 42
| done _ |> _
Must fail at backend compile:
Code generation must reject the program.
Flows
flow ~prompt-user click a branch to expand · @labels scroll to their anchor
prompt-user (question: "?")