056 self outside init must refuse not panic

✓ Passing Passing: the compiler rejects this program as expected.

Code

input.k

Actual compiler output

error[KORU170]: `std/kernel:self` outside a `std/kernel:init` subtree — a kernel op needs a kernel view to operate on
  --> tests/regression/300_ADVANCED_FEATURES/390_KERNEL/390_056_self_outside_init_must_refuse_not_panic/input.k:121:0
  hint: wrap it, e.g. `std/kernel:init(bodies) | kernel k |> std/kernel:self { ... }`

Output must match:

# The refusal must be a located koru-level diagnostic...
CONTAINS error[KORU
# ...and must NOT be the raw host panic the transform raises today.
NOT_CONTAINS could not find invocation in AST

Flows

flow ~shape click a branch to expand · @labels scroll to their anchor
shape (expr: Body, source: mass: f64,)
flow ~self click a branch to expand · @labels scroll to their anchor
self (source: k.mass *= 2.0)

Test Configuration

MUST_ERROR