✓
Passing Passing: the compiler rejects this program as expected.
Code
// PIN (enforcement): quantity:add demands <exact!>; a bare string
// holds no live obligation — phantom state mismatch.
import std/quantity
std/quantity:lit { 1 m }
| exact a |> std/quantity:add(a, b: "2 m")
| exact r |> _
| dim-mismatch |> _
| mixed-cov |> _
| bad _ |> _
Actual compiler output
error[KORU030]: Phantom state mismatch: '"2 m"' (parameter 'b') holds no live '<exact!>' obligation to consume here — it was never acquired or has already been discharged. Pass a value that still holds its '<exact!>' obligation.
--> tests/regression/600_STDLIB/615_NUM/615_027_reject_untainted_quantity/input.k:6:1Backend must reject with:
CONTAINS error[KORU030]
CONTAINS Phantom state mismatchFlows
flow ~lit click a branch to expand · @labels scroll to their anchor
lit (source: 1 m)
Test Configuration
MUST_ERROR