✗
Failing This test is currently failing.
Failed: backend-exec
Failure Output
Showing last 10 of 11 lines
--> phantom_semantic_check:5:0
❌ Compiler coordination error: Phantom semantic validation failed
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_023_if_auto_both_branches/backend.zig:94:13: 0x10294b38b in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_023_if_auto_both_branches/backend.zig:190:28: 0x10294c077 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^ Code
~import std/control
~import app/fs
const condition = true;
~app/fs:open(path: "test.txt")
| opened _ |> if(condition)
| then |> _ // Auto-discharge inserts close here
| else |> _ // Auto-discharge inserts close here too
Expected output
Opening file: test.txt
Closing file
Imported Files
// Library module: fs
// Defines filesystem operations with cleanup obligations
const std = @import("std");
// File type with phantom states
const File = struct {
handle: i32,
};
// Open a file - returns opened! state (requires cleanup)
~pub event open { path: []const u8 }
| opened *File<opened!>
~proc open|zig {
std.debug.print("Opening file: {s}\n", .{path});
const allocator = std.heap.page_allocator;
const f = allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return .{ .opened = f };
}
// Close a file - CONSUMES opened! state (disposes the resource)
~pub event close { file: *File<!opened> }
~proc close|zig {
std.debug.print("Closing file\n", .{});
}
Test Configuration
MUST_RUN