✗
Failing This test is currently failing.
Failed: frontend
Failure Output
Showing last 10 of 17 lines
--> /Users/larsde/src/orisha/lib/index.kz:762:1
|
762 | ~[comptime|transform]pub event router {
| ^
error[PARSE003]: single continuation branch 'transformed' carrying a payload is a one-variant tag union — declare the single output as a bare return instead: `-> <type>`
--> /Users/larsde/src/orisha/lib/index.kz:1352:1
|
1352 | ~[comptime|transform]pub event static-router {
| ^ Code
// NEGATIVE TEST — orisha:router must reject TERMINAL (`|`) pattern branches.
//
// The router dispatches INTO the matched route — effect semantics — so its
// pattern branches must be effect branches (`!`). The `[GET /path]` bracket
// syntax is just a branch-name escape, orthogonal to `|`/`!` kind. Orisha
// predates `BranchKind` and was kind-blind, silently accepting `| [pattern]`.
// This pins that the transform is now kind-aware and rejects `|` loudly.
~import orisha
~import std/io
const std = @import("std");
const TestRequest = struct {
method: []const u8,
path: []const u8,
};
const req = TestRequest{ .method = "GET", .path = "/" };
// `|` here is WRONG — these are dispatch handlers, must be `!`.
~orisha:router(req: &req)
| [GET /] |> std/io:print.ln("matched GET /")
| [*] |> std/io:print.ln("catch-all")
Must contain:
orisha:router pattern branches must use effectError Verification
Actual Compiler Output
error[PARSE003]: single continuation branch 'response' carrying a payload is a one-variant tag union — declare the single output as a bare return instead: `-> <type>`
--> /Users/larsde/src/orisha/lib/index.kz:236:1
|
236 | ~[abstract|retain]pub event handler { req: *Request }
| ^
error[PARSE003]: single continuation branch 'transformed' carrying a payload is a one-variant tag union — declare the single output as a bare return instead: `-> <type>`
--> /Users/larsde/src/orisha/lib/index.kz:762:1
|
762 | ~[comptime|transform]pub event router {
| ^
error[PARSE003]: single continuation branch 'transformed' carrying a payload is a one-variant tag union — declare the single output as a bare return instead: `-> <type>`
--> /Users/larsde/src/orisha/lib/index.kz:1352:1
|
1352 | ~[comptime|transform]pub event static-router {
| ^Flows
flow ~router click a branch to expand · @labels scroll to their anchor
router (req: &req)
Test Configuration
MUST_FAIL