✓
Passing Passing: the compiler rejects this program as expected.
Code
// ASPIRATION — TODO idea pin (designed rejection). T2 + queue (d): the
// interceptor cascade graph is comptime-visible; a cross-store cycle
// (alpha's contract writes beta, beta's writes alpha) is rejected at
// compile time WITH THE CYCLE NAMED — never an infinite cascade at
// runtime. Field-level graph; @converges carve-out for clamp shapes is
// the open (d) detail.
import std/io
import std/store
std/store:new(alpha) { x: 0[i64] }
! updated { old, new } |> std/store:stored { beta.y: new }
std/store:new(beta) { y: 0[i64] }
! updated { old, new } |> std/store:stored { alpha.x: new }
std/store:stored { alpha.x: 1 }
Actual compiler output
error[KORU161]: std/store: store cascade cycle: alpha.x -> beta.y -> alpha.x - interceptor contracts must be acyclic; a convergent self-write needs @converges (unbuilt, queue (d))
--> tests/regression/600_STDLIB/690_STORE/690_012_store_reject_cascade_cycle/input.k:11:0
error[KORU161]: std/store:stored: unknown store 'alpha' - no std/store:new(alpha) found
--> tests/regression/600_STDLIB/690_STORE/690_012_store_reject_cascade_cycle/input.k:15:0
error[KORU161]: std/store:stored: unknown store 'alpha' - no std/store:new(alpha) found
--> tests/regression/600_STDLIB/690_STORE/690_012_store_reject_cascade_cycle/input.k:17:0Backend must reject with:
CONTAINS cycle
CONTAINS alpha
CONTAINS betaError output must contain
store cascade cycle: alpha.x -> beta.y -> alpha.x — interceptor contracts must be acyclic; a convergent self-write needs @convergesFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (alpha, source: x: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (beta, source: y: 0[i64])
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: alpha.x: 1)
Test Configuration
MUST_ERROR LANGUAGES: zig cs