✓
Passing Passing: the compiler rejects this program as expected.
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 — KORU114, naming a tor spelled
// `const SIEVE_BITS: usize` that the author never wrote.
//
// 2026-09-26: 8aee85104 (impl-name spellability) moved the refusal earlier
// — the same mis-parse now dies at PARSE003 (`impl name ' usize' is not one a
// call site can spell`) instead of reaching abstract/impl pairing. The
// diagnostic is still impl-flavored for a `const` the author never spelled
// that way; the clean refusal this pin ultimately wants is a `.k`-boundary
// rejection, not a better impl complaint. EXPECT re-pinned to PARSE003.
//
// 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")
Actual compiler output
error[PARSE003]: impl name ' usize' is not one a call site can spell — each '.'-separated piece is an identifier (or '*' for a transform glob)
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_133_reject_bare_const_decl_dot_k/input.k:35:19
|
35 | const SIEVE_BITS: usize = 500000;
| ^Frontend must reject with:
CONTAINS error[PARSE003]
CONTAINS not one a call site can spellTest Configuration
MUST_ERROR