○
Planned This feature is planned but not yet implemented.
Feature: Phantom state mismatch detection
Failure Output
error[KORU033]: invalid phantom-state syntax
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/909_phantom_state_mismatch/input.kz:8:37
|
8 | ~tor close-file { file: *std.fs.File[closed] }
| ^
hint: phantom state uses angle brackets — write `*std.fs.File<closed>` Code
const std = @import("std");
~tor open-file {} -> *std.fs.File[open]
~proc open-file|zig {
const allocator = std.heap.page_allocator;
const f = allocator.create(std.fs.File) catch unreachable;
return f;
}
~tor close-file { file: *std.fs.File[closed] }
~proc close-file|zig {
}
~open-file(): o |> close-file(o.file)
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Flows
flow ~open-file click a branch to expand · @labels scroll to their anchor
open-file