✓
Passing This code compiles and runs correctly.
Code
pub const File = struct {
handle: usize,
};
~event open-file { path: []const u8 }
| opened *File<open>
~event close-file { file: *File<closed> }
~event read-file { file: *File<open> }
~event write-file { file: *File<open> }
~proc open-file|zig {
const f = File{ .handle = 42 };
return .{ .opened = &f };
}
~proc close-file|zig {
_ = file;
return .{ .done = .{} };
}
~proc read-file|zig {
_ = file;
}
~proc write-file|zig {
_ = file;
return .{ .done = .{} };
}
~open-file(path: "test1.txt")
| opened o |> close-file(o.file)
~open-file(path: "test2.txt")
| opened o |> close-file(o.file)
~open-file(path: "test3.txt")
| opened o |> close-file(o.file)
Must contain:
Phantom state mismatchError Verification
Expected Error Pattern
This test must fail with phantom state mismatch errors.
All three errors should be reported in a single compilation pass.Actual Compiler Output
error[KORU030]: Phantom state mismatch: argument 'file' has no tracked phantom state, but event requires '<closed>'. The value must be in state 'input:closed'.
--> phantom_semantic_check:25:0
error[KORU030]: Phantom state mismatch: argument 'file' has no tracked phantom state, but event requires '<closed>'. The value must be in state 'input:closed'.
--> phantom_semantic_check:27:0
error[KORU030]: Phantom state mismatch: argument 'file' has no tracked phantom state, but event requires '<closed>'. The value must be in state 'input:closed'.
--> phantom_semantic_check:29:0
❌ Compiler coordination error: Phantom semantic validation failed
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/920_multiple_errors/backend.zig:94:13: 0x10246f38b in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/920_multiple_errors/backend.zig:190:28: 0x102470077 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^Test Configuration
MUST_FAIL