✓
Passing This code compiles and runs correctly.
Code
// PIN: phantom state in a type position must use ANGLE brackets `<state>`.
// The square-bracket form `[state!]` must be a hard parse error — NOT silently
// swallowed into the type string with phantom=null (which gives zero obligation
// checking and false safety). See AST: `*Resource[active!]` → type stays
// "*Resource[active!]", phantom=null; `*Resource<active!>` → type "*Resource",
// phantom="active!".
~event use-sq { r: *Resource[active!] }
~proc use-sq|zig { _ = r; }
Frontend must reject with:
CONTAINS error[KORU033]
CONTAINS angle bracketsError Verification
Actual Compiler Output
error[KORU033]: invalid phantom-state syntax
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_120_reject_square_bracket_phantom/input.kz:4:51
|
4 | // checking and false safety). See AST: `*Resource[active!]` → type stays
| ^
hint: phantom state uses angle brackets — write `*Resource<active!>`Test Configuration
MUST_FAIL