✓
Passing This code compiles and runs correctly.
Code
// Test: Parser should reject ~ (tilde) inside a Koru flow
// The ~ is a LEADER character that switches from host-language to Koru.
// Inside a continuation pipeline, you're already IN Koru, so ~ is invalid.
~import std/io
~import std/control
// This is WRONG - ~ should not appear inside flows
~capture { total: 0[i32] }
! as acc |> captured { total: acc.total + 42 }
| captured |> ~std/io:println("Should reject this!")
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Expected compiler error
error[PARSE001]: Nested flows (~) are not allowed inside continuations. Use a bare event call instead: remove the ~ prefix.
--> tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_011_reject_tilde_inside_flow/input.kz:11:0
|
11 | | captured |> ~std/io:println("Should reject this!")
| ^