✓
Passing Passing: the compiler rejects this program as expected.
Code
pub const File = struct {
handle: usize,
};
~tor open-file { path: string } -> *File<open>
~tor close-file { file: *File<closed> }
~tor read-file { file: *File<open> }
~tor write-file { file: *File<open> }
~proc open-file|zig {
const f = File{ .handle = 42 };
return &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"): o |> close-file(o.file)
~open-file(path: "test2.txt"): o |> close-file(o.file)
~open-file(path: "test3.txt"): o |> close-file(o.file)
Actual compiler output
error[KORU030]: Phantom state mismatch: argument 'file' has no tracked phantom state, but this event requires state '<closed>'.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/920_multiple_errors/input.kz:23:0
error[KORU030]: Phantom state mismatch: argument 'file' has no tracked phantom state, but this event requires state '<closed>'.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/920_multiple_errors/input.kz:24:0
error[KORU030]: Phantom state mismatch: argument 'file' has no tracked phantom state, but this event requires state '<closed>'.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/920_multiple_errors/input.kz:25:0
❌ Compiler coordination error: Phantom semantic validation failed
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must contain:
Phantom state mismatchFlows
flow ~open-file click a branch to expand · @labels scroll to their anchor
open-file (path: "test1.txt")
flow ~open-file click a branch to expand · @labels scroll to their anchor
open-file (path: "test2.txt")
flow ~open-file click a branch to expand · @labels scroll to their anchor
open-file (path: "test3.txt")
Test Configuration
MUST_ERROR