✓
Passing This code compiles and runs correctly.
Code
// Pins the ENTITY analogue of 335_020: when a taken Enemy<std/store:taken!>
// reaches scope exit with TWO events consuming <std/store:!taken>, auto-discharge
// has multiple discharge options and must NOT silently pick — KORU030 fires,
// forcing an explicit choice.
// Same "ambiguity forces a pick" wall as KORU140 ([with] collision) and 335_020
// (string free vs release). The discharger is authored per type; two of them is
// the ambiguity. Removing either despawn-* below makes 690_034's auto-insert fire.
import std/io
import std/store
[entity(enemy)]std/store:new(enemies) { hp: i64 }
pub event despawn-quietly { enemy: Enemy<std/store:!taken> }
despawn-quietly = std/io:print.ln("quietly despawned")
pub event despawn-loudly { enemy: Enemy<std/store:!taken> }
despawn-loudly = std/io:print.ln("LOUDLY despawned")
std/store:insert(enemies) { hp: 9 }
| row r |> std/store:take(enemies[r])
| item i |> std/io:print.ln("took hp {{ i.hp:d }}")
Must contain:
multiple discharge optionsError Verification
Actual Compiler Output
error[KORU030]: Resource 'i' <taken!> has multiple discharge options: despawn-loudly, despawn-quietly. Discharge explicitly.
--> auto_discharge:20:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
error: CompilerCoordinationFailed
???:?:?: 0x1030339d3 in _backend.RuntimeEmitter.emit (???)
???:?:?: 0x103034b63 in _backend.main (???)Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: enemies, source: hp: i64)
subflow ~despawn-quietly click a branch to expand · @labels scroll to their anchor
print.ln (expr: "quietly despawned")
subflow ~despawn-loudly click a branch to expand · @labels scroll to their anchor
print.ln (expr: "LOUDLY despawned")
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: enemies, source: hp: 9)
Test Configuration
MUST_FAIL