✗
Failing This test is currently failing.
Failed: backend-exec
Failure Output
Showing last 10 of 14 lines
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_012_auto_discharge_explicit_with_multiple/input.kz:3:0
❌ Compiler coordination error: Incomplete branch coverage
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_012_auto_discharge_explicit_with_multiple/backend.zig:94:13: 0x10085738b in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_012_auto_discharge_explicit_with_multiple/backend.zig:190:28: 0x100858077 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^ Code
~import app/fs
~app/fs:open(path: "test.txt")
| opened f |> app/fs:lock(file: f)
| locked l |> app/fs:write(file: l, data: "test") |> app/fs:unlock(file: l)
| err _ |> app/fs:force-close(file: l)
Expected output
Writing: test
Unlocking
Imported Files
// Library module: fs
// State transitions with multiple disposal options (mimics string library)
const std = @import("std");
const File = struct { handle: i32 };
// Open a file - returns opened! state
~pub event open { path: []const u8 }
| opened *File<opened!>
~proc open|zig {
const f = std.heap.page_allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return .{ .opened = f };
}
// Lock - transition opened! -> locked!
~pub event lock { file: *File<!opened> }
| locked *File<locked!>
~proc lock|zig {
return .{ .locked = file };
}
// Write - requires locked state (doesn't consume)
~pub event write { file: *File<locked>, data: []const u8 }
| err []const u8
~proc write|zig {
std.debug.print("Writing: {s}\n", .{data});
}
// Unlock - consumes locked! (Option 1 for disposing locked!)
~pub event unlock { file: *File<!locked> }
~proc unlock|zig {
std.debug.print("Unlocking\n", .{});
std.heap.page_allocator.destroy(file);
}
// Force close - also consumes locked! (Option 2 for disposing locked!)
~pub event force-close { file: *File<!locked> }
~proc force-close|zig {
std.debug.print("Force closing\n", .{});
std.heap.page_allocator.destroy(file);
}
Test Configuration
MUST_RUN