label scope errors

✓ Passing This code compiles and runs correctly.

Code

input.kz

Must contain:

unknown label

Error Verification

Expected Error Pattern

Label Scope Validation Test

This test MUST FAIL to verify that labels are flow-scoped.

Expected behavior:
- Flow 1 defines label 'loop'
- Flow 2 tries to jump to 'loop' which is out of scope
- Shape checker should reject this with "Unknown label 'loop'"

This validates that label scope checking is working correctly in the backend.

Actual Compiler Output

error[KORU041]: unknown label '@loop'
  --> tests/regression/000_CORE_LANGUAGE/040_CONTROL_FLOW/206_label_scope_errors/input.kz:41:0

❌ Compiler coordination error: Unknown label referenced
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/040_CONTROL_FLOW/206_label_scope_errors/backend.zig:94:13: 0x104f1738b in emit (backend)
            return error.CompilerCoordinationFailed;
            ^
/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/040_CONTROL_FLOW/206_label_scope_errors/backend.zig:190:28: 0x104f18077 in main (backend)
    const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
                           ^

Test Configuration

MUST_FAIL