021 label jump scope outer ok

✗ Failing This test is currently failing.

Failed: backend-exec

Failure Output

Showing last 10 of 11 lines
  --> tests/regression/300_ADVANCED_FEATURES/370_PHANTOM_TYPES/370_021_label_jump_scope_outer_ok/input.kz:35:0

❌ Compiler coordination error: Incomplete branch coverage
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/370_PHANTOM_TYPES/370_021_label_jump_scope_outer_ok/backend.zig:9449:17: 0x1048c64af in emit (backend)
                return error.CompilerCoordinationFailed;
                ^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/370_PHANTOM_TYPES/370_021_label_jump_scope_outer_ok/backend.zig:9533:28: 0x1048c72b7 in main (backend)
    const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
                           ^

Code

// TEST: Label jump inside @scope should not require passing OUTER obligations
// STATUS: MUST_PASS
//
// The resource is created outside @scope. The label jump occurs inside @scope.
// This should be allowed (outer obligations are suspended).

const std = @import("std");

const Resource = struct { id: i32 };

~event create {}
| created *Resource[open!]

~proc create {
    const r = std.heap.page_allocator.create(Resource) catch unreachable;
    r.* = .{ .id = 1 };
    return .{ .created = r };
}

~event close { res: *Resource[!open] }

~proc close {
    std.heap.page_allocator.destroy(res);
}

~pub event with_context {}

~proc with_context {
}

~#loop create()
| created c |> with_context() |> close(res: c)
    | scoped _[@scope] |> @loop()

pub fn main() void {}
input.kz

Test Configuration

MUST_RUN