✓
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: 17 (flow-based: frontend, analysis, emission)
Error: output_emitted.zig:30: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:29:25
main: output_emitted.zig:473:5
4 reference(s) hidden; use '-freference-trace=6' to see all referencesFlows
flow ~match click a branch to expand · @labels scroll to their anchor
match (expr: "42")
Test Configuration
MUST_FAIL