291 view private leaf unguarded refused

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

Code

input.k

Actual compiler output

error[KORU161]: std/store:query(Entities): 'e.mana' is Player-only — narrow the guard (`when e is Player`) first
  --> tests/regression/600_STDLIB/690_STORE/690_291_view_private_leaf_unguarded_refused/input.k:30:0

Must fail at runtime with:

CONTAINS is Player-only — narrow the guard

Flows

flow ~i64 click a branch to expand · @labels scroll to their anchor
i64 (expr: Strength)
flow ~i64 click a branch to expand · @labels scroll to their anchor
i64 (expr: Mana)
flow ~i64 click a branch to expand · @labels scroll to their anchor
i64 (expr: Armor)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Player, source: str: Strength mana: Mana)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Enemy, source: str: Strength armor: Armor)
flow ~new click a branch to expand · @labels scroll to their anchor
new (Player, capacity: 8, source: Player)
flow ~new click a branch to expand · @labels scroll to their anchor
new (Enemy, capacity: 8, source: Enemy)
flow ~view click a branch to expand · @labels scroll to their anchor
view (Entities, source: Player Enemy)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (Player, source: str: 18, mana: 12)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (Enemy, source: str: 10, armor: 5)
flow ~query click a branch to expand · @labels scroll to their anchor
query (Entities)

Test Configuration

MUST_ERROR