011 optional branch catchall

✓ Passing This code compiles and runs correctly.

Code

// ============================================================================
// Test 060: Optional Branch Catch-All |? Syntax
// Tests that the parser accepts optional branch catch-all patterns:
// 1. Simple |? discard: |? |> _
// 2. With Transition meta: |? Transition t |> log(t)
// 3. With Profile meta: |? Profile p |> log(p)
// 4. Mix of explicit handling + catch-all
// ============================================================================

// Event with required and optional branches
~event process { value: u32 }
| success { result: u32 }        // Required
| ?warning { msg: []const u8 }   // Optional
| ?debug { details: []const u8 } // Optional

// Test 1: Simple |? discard
~process(value: 10)
| success |> _
|? |> _

// Test 2: |? with Transition metatype binding
~process(value: 20)
| success |> _
|? Transition |> _

// Test 3: |? with Profile metatype binding
~process(value: 30)
| success |> _
|? Profile |> _

// Test 4: Mix explicit optional handling + catch-all
~process(value: 40)
| success |> _
| warning |> _  // Explicit handling of optional branch
|? |> _           // Catches remaining optional branches (debug)

// Test 5: |? catches ALL unhandled optional branches
~process(value: 50)
| success |> _
|? Transition |> _  // Catches both warning and debug
input.kz

Test Configuration

Expected Behavior:

BACKEND_COMPILE_ERROR