✗
Failing This test is currently failing.
Failed: wrong-error
Error Details
output_emitted.zig:80:9: error: expected statement, found 'pub'
Failure Output
🎯 Compiler coordination: Passes: 20 (flow-based: elaborate, analysis, emission)
Error: output_emitted.zig:80:9: error: expected statement, found 'pub'
pub fn main() void {
^~~ Code
// TEST: Phantom obligation tracking across label jumps
// STATUS: MUST_ERROR (fixed)
//
// BUG: When a label jump (@loop) occurs, phantom obligations from the
// current scope are not being checked. This allows resource leaks.
//
// EXPECTED: Compiler error - obligation not satisfied before @loop
// ACTUAL: Compiler error (KORU030) once obligations are enforced
//
// This test documents the gap discovered while building Orisha HTTP server.
// The `| failed |> @accept_loop(server: s)` branch leaks the connection.
const std = @import("std");
const Resource = struct { id: i32 };
~tor create {} -> *Resource<open!>
~proc create|zig {
const r = std.heap.page_allocator.create(Resource) catch unreachable;
r.* = .{ .id = 42 };
return r;
}
~tor use { res: *Resource<open> }
| ok *Resource<open>
| failed *Resource<open>
~proc use|zig {
// Simulate sometimes failing
if (res.id == 42) {
return .{ .ok = res };
}
return .{ .failed = res };
}
~tor close { res: *Resource<!open> }
~proc close|zig {
std.heap.page_allocator.destroy(res);
}
// THE BUG: This flow should NOT compile!
// The `| failed |> @loop` branch has an open obligation that is never discharged.
~#loop create(): c |> use(c.res): o |> close(o.res): _f |> @loop() // BUG! c.res has <open!> obligation, not discharged!
pub fn main() void {
std.debug.print("Test compiled - BUG: should have been rejected!\n", .{});
}
Must contain:
Phantom state mismatchFlows
flow ~create click a branch to expand · @labels scroll to their anchor
#loop create