✗
Failing This test is currently failing.
Failed: backend-exec
Failure Output
Showing last 10 of 11 lines
--> phantom_semantic_check:4:0
❌ Compiler coordination error: Phantom semantic validation failed
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_016_scope_nested/backend.zig:94:13: 0x1031d738b in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_016_scope_nested/backend.zig:190:28: 0x1031d8077 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^ Code
~import std/control
~import app/fs
~for(0..2)
! each _ |> app/fs:open(path: "outer.txt")
| opened _ |> for(0..2)
! each _ |> app/fs:open(path: "inner.txt")
| opened _ |> _ // Auto-close inner here
| done |> _ // Auto-close outer_f here
| done |> _
Expected output
Opening: outer.txt
Opening: inner.txt
Closing
Opening: inner.txt
Closing
Closing
Opening: outer.txt
Opening: inner.txt
Closing
Opening: inner.txt
Closing
Closing
Imported Files
// Library module: fs
// Single disposal event
const std = @import("std");
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: {s}\n", .{path});
const f = std.heap.page_allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return .{ .opened = f };
}
// Close - the ONLY consumer of [!opened]
~pub event close { file: *File<!opened> }
~proc close|zig {
std.debug.print("Closing\n", .{});
}
Test Configuration
MUST_RUN