✓
Passing This code compiles and runs correctly.
Code
// STRICT 1:1, the discard side: a pattern that declares named groups but
// discards the payload asked for captures it never takes delivery of.
// The discard form lives in the PATTERN — spell unwanted captures `(...)`.
import std/io
import std/regex
std/regex:match("42")
| `(?<x>[0-9]+)` _ |> std/io:print.ln("num")
| no-match |> std/io:print.ln("no")
Must contain:
spell it (...)Error Verification
Actual Compiler Output
🎯 Compiler coordination: Passes: 14 (flow-based: frontend, analysis, emission)
Error: output_emitted.zig:10:16: error: regex match: pattern `(?<x>[0-9]+)` declares named groups but the branch discards the payload — destructure them, bind the payload, or make the unwanted capture non-capturing: spell it (...)
comptime { @compileError("regex match: pattern `(?<x>[0-9]+)` declares named groups but the branch discards the payload — destructure them, bind the payload, or make the unwanted capture non-capturing: spell it (...)"); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
main_module: output_emitted.zig:9:25
main: output_emitted.zig:438:5
4 reference(s) hidden; use '-freference-trace=6' to see all referencesTest Configuration
MUST_FAIL