✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: the REFUSAL of a cross-width narrowing write — an f64-valued
// expression (f32 column + f64 column peer-resolves to f64) stored back
// into the f32 column. Narrowing loses bits; the write is refused, never
// silently rounded.
//
// The scalar gate admits both widths side by side (store.kz's i64/i32/
// f64/f32 set; f64 pinned at 690_021/690_111), and the WIDENING direction
// flows — f32 read into f64 arithmetic coerces losslessly. Only the
// narrowing store is refused, at the write envelope's typed slot.
//
// The pinned diagnostic is the backend's: it quotes emitted Zig, not the
// input.k write site. If a store-level wall lands in front of it, this
// substring stops matching and the pin flips — update it to the wall's
// diagnostic then.
import std/io
import std/store
std/store:new(bodies, capacity: 4) { x: f32, big: f64 }
std/store:insert(bodies) { x: 1.5, big: 2.25 }
std/store:query(bodies)
! query b |> std/store:stored { b.x: b.x + b.big }
std/store:query(bodies)
! query r |> std/io:print.ln("x {{ r.x:f }}")
Actual compiler output
🎯 Compiler coordination: Passes: 20 (flow-based: elaborate, analysis, emission)
Error: output_emitted.zig:231:151: error: expected type 'f32', found 'f64'
const result = main_module.__store_write_bodies_event.handler(.{ .row = __koru_sdix_b_L25, .field = 0, .value_0 = __koru_store_bodies.x[__koru_sdix_b_L25] + __koru_store_bodies.big[__koru_sdix_b_L25], .value_1 = 0.0 });
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
handler [inlined]: output_emitted.zig:223:39
handler: output_emitted.zig:244:133
5 reference(s) hidden; use '-freference-trace=7' to see all referencesMust fail at runtime:
Program must error when executed.
Error output must contain
expected type 'f32', found 'f64'Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (bodies, capacity: 4, source: x: f32, big: f64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (bodies, source: x: 1.5, big: 2.25)
flow ~query click a branch to expand · @labels scroll to their anchor
query (bodies)
flow ~query click a branch to expand · @labels scroll to their anchor
query (bodies)
Test Configuration
MUST_ERROR LANGUAGES: zig cs