✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test (negative): a bare literal `22.5` at a call site MUST be rejected
// when the parameter requires a phantom annotation (`f32<celsius>`).
//
// Completes the triangle for literal-suffix phantom annotation:
// - 210_087 parser accepts `22.5<celsius>` syntax
// - 330_066 literal-suffix works end-to-end (parse + check + emit + run)
// - 330_067 bare literal WITHOUT the suffix is rejected (this test)
//
// Without this rejection test, the literal-suffix feature could be (mis)
// implemented as optional — silently accepting bare literals at
// phantom-required positions, defeating the whole safety story.
//
// Currently this rejection fires because the phantom checker tracks no
// state for a bare literal value. Once literal-suffix lands, this test
// continues to pin that the suffix is REQUIRED at this boundary, not
// optional.
//
// Sibling: 330_064 covers the same rejection for values produced by an
// event whose payload is a bare-typed `f32` (no phantom). This test covers
// the literal-at-call-site variant.
~tor to-fahrenheit { c: f32<celsius> } -> f32<fahrenheit>
~to-fahrenheit -> c * 9.0 / 5.0 + 32.0
// ERROR: `22.5` is bare — no phantom state. f32 can't satisfy f32<celsius>.
~to-fahrenheit(c: 22.5)
Actual compiler output
error[KORU030]: Phantom state mismatch: argument 'c' has no tracked phantom state, but this event requires state '<celsius>'.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_067_reject_bare_literal_at_phantom_param/input.kz:27:0
❌ Compiler coordination error: Phantom semantic validation failed
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must fail at runtime:
Program must error when executed.
Error output must contain
Phantom state mismatch: argument 'c' has no tracked phantom stateFlows
flow ~to-fahrenheit click a branch to expand · @labels scroll to their anchor
to-fahrenheit (c: 22.5)
Test Configuration
MUST_ERROR