004 loop body discharges outer

✓ Passing This code compiles and runs correctly.

Code

input.kz

Must contain:

KORU032

Error Verification

Actual Compiler Output

error[KORU032]: Cannot discharge outer-scope resource 'outer_f' inside @scope boundary. Handle outside the scope or escape via branch constructor.
  --> auto_discharge:15:0

❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/335_OBLIGATION_STRESS/335_004_loop_body_discharges_outer/backend.zig:94:13: 0x10115e3b3 in emit (backend)
            return error.CompilerCoordinationFailed;
            ^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/335_OBLIGATION_STRESS/335_004_loop_body_discharges_outer/backend.zig:190:28: 0x10115f09f in main (backend)
    const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
                           ^

Imported Files

fs.kz

Test Configuration

MUST_FAIL