✓
Passing This code compiles and runs correctly.
Code
// PINS A BUG (not yet fixed — see comment below): a bare, non-braced
// `const NAME: Type = value;` line in a pure-Koru `.k` file is neither
// accepted nor cleanly rejected. It SHOULD be rejected at the parser
// boundary: `.k` files have no host-Zig escape at all (`~`-prefixed lines
// are already rejected with PARSE003 — see 's parser.zig:677-696), and the
// only legal `const` shape in a `.k` file is the braced declaration form
// from koru_std/declarations.kz: `const { name: value, ... }`.
//
// Instead, `src/parser.zig` synthesizes a leading `~` for any non-`|`/`!`
// top-level `.k` line (parser.zig:719-727) and dispatches it through the
// general construct machinery. A bare `const NAME: Type = value;` line
// doesn't match the braced `const {}` keyword shape, so it falls through
// into the generic `name = call(...)` flow-implementation grammar instead,
// which mis-tokenizes it into a bogus flow item:
// { "type": "flow", "invocation": { "event": ["500000;"] }, "impl_of": [" usize"] }
// (verified via `koruc --ast-json` on this exact file). That phantom
// "implements abstract event `usize`" item then poisons
// `validate_abstract_impl.zig`'s impl/abstract-event pairing, which is what
// actually fires below — `ImplTargetNotAbstract`, a raw Zig error with a
// non-deterministic address-laden stack trace, not a koru-level diagnostic
// naming the real offending line.
//
// Found 2026-06-30 while fixing the prime-sieve drag-race `faithful.k` entry
// (forcing a runtime-sized `std/field:new` allocation rather than a
// comptime-literal one). Lars: capture and pin now; root-cause + fix later.
import std/io
const SIEVE_BITS: usize = 500000;
std/io:print.ln("hi")
Frontend must reject with:
CONTAINS ImplTargetNotAbstractError Verification
Actual Compiler Output
error: ImplTargetNotAbstract
/Users/larsde/src/koru/src/validate_abstract_impl.zig:219:17: 0x104ba2deb in validateImplementations (koruc)
return ValidationError.ImplTargetNotAbstract;
^
/Users/larsde/src/koru/src/validate_abstract_impl.zig:74:9: 0x104ba340f in validate (koruc)
try validator.validateImplementations();
^
/Users/larsde/src/koru/src/main.zig:7127:5: 0x104cf1863 in main (koruc)
try validate_abstract_impl.AbstractImplValidator.validate(parse_allocator, source_file.items);
^Flows
subflow ~ usize click a branch to expand · @labels scroll to their anchor
500000;
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "hi")
Test Configuration
MUST_FAIL