Diagnostics Reference

Every Bee diagnostic code, grouped by module. This is a compiler-builder's single source of truth for the error surface: each code is first registered in registry/diagnostics.json before it may appear in any /spec or /tutorial table. The tables below are generated faithfully to that registry.

Severity legend

SeverityMeaning
EHard error — fatal; halts the build or traps at runtime unless handled.
WSoft warning — non-fatal; logged to stderr and does not change the exit status.

Coding convention

  • Block rule: module <dd> owns block E<dd>xx, where <dd> is the module's leading digit (01 → E01, 02 → E02, … 14 → E14).
  • Memory block: module 00 (memory model) has no natural E00xx range (E00xx is reserved for global/deprecation codes), so memory uses the first free block E08xx.
  • Collision policy: if a proposed code already exists with different semantics, the newer use is bumped to the next free slot in its module block and re-registered. A skipped slot within a block is therefore intentional.

Global codes

Cross-cutting codes shared by every module. Up-scope targets for Phase 7.2 deprecation hardening. Source: spec/00,01,02,03 + decisions D12/D14/D15.

CodeSeverityConditionResolution
E0009EUpscope target for deprecated symbols/keywords once Phase 7.2 migration completes (replaces E0010/E0011 as hard).Rewrite using the canonical ratified form.
E0010ELegacy form encountered: 'repeat' (use 'next', D15), '≠'/'=='/'!='/'<>' (use '¬'/'='/¬, D12), '.!'/'!.'/'!!' range glyphs (use '..<'/'>..'/'>..<', D13).Replace with the canonical form; non-fatal until Phase 7.2 hardens to E0009.
E0011ELegacy 'using' / 'using:' postfix on io_stmt or rule call (D6).Use curried named-argument call form (sep: ...); non-fatal until hardened to E0009.
W0901WParser reached a token stream with no statements produced; soft warning attached to parser error surface.Author statements that the rigid syntax gate recognizes.

E00 / E08 — Memory model

Memory module spec/00-memory-model.md §5. Block moved from the overloaded E04xx range to the free E08xx on 2026-09-14 (spec/04 retains E0401–E0406). Related page: memory.html.

CodeSeverityConditionResolution
E0801ERead or write of an identifier after a 'zap' statement in the same control-flow graph.Compile-time fatal error with source line location; runtime 'Panic: UseAfterZap' under -d.
E0802EPointer escapes a Region Arena into an outer scope.Compiler automatically promotes the allocation from Region to ARC Heap.
E0803EUnhandled cycle in an ARC structure.Static lifetime analysis, or runtime leak warning under -d.
E0804ECross-thread mutation of an unshared reference.Compile-time data-race restriction.

E01 — Lexical structure

Lexical structure module spec/01-lexical-structure.md §6. Related page: syntax.html.

CodeSeverityConditionResolution
E0101EUnexpected UTF-8 BOM marker at source start.Strip the BOM from the source header.
E0102EBlock comment ('+-') without a closing '-+'.Ensure closing '-+' exists.
E0103EInvalid escape sequence in a string literal.Use valid \n, \t, \uXXXX escapes.
E0104ESingle-letter uppercase variable identifier.Use a lowercase start or a multi-letter type identifier.
E0105EUnterminated string literal or markup block.Check closing quotes or the matching markup tag.

E02 — Statements

Statements module spec/02-statements.md §7 (+ D14/D15). Related page: control.html.

CodeSeverityConditionResolution
E0201EStatement not aligned to the 2-space offset boundary.Re-indent to the canonical 2-space block depth.
E0202EMutation of a variable without a prior 'new' declaration.Declare the variable first.
E0203EMissing 'done' or 'return' terminator.Terminate the block with 'done [label];' (D14) or 'return;'.
E0204EUsing the '::' clone operator on a non-clonable primitive.Use ':=' or restrict '::' to boxed/object targets.
E0205EClosing label on 'done' does not match the opening header label.Align 'done' label with the block header label.
E0206E'next', 'stop', or 'redo' used outside a loop body.Move the jump inside a loop (D14/D15).

E03 — Rules

Rules module spec/03-rules.md §7 (+ D6). Related page: rules.html.

CodeSeverityConditionResolution
E0301ERule invoked prior to definition or forward declaration.Define or forward-declare the rule first.
W0301WAssertion failed in an 'assert' contract clause.Logged to stderr; review the asserted invariant.
E0303EExpectation failed in an 'expect' contract clause or body statement.Fatal runtime error if unhandled.
E0304EMulti-result rule used inside an arithmetic expression tree.Call the rule at statement level and deconstruct its results.
E0305ERule block does not end with an aligned 'return;'.Append 'return;' at the rule end.
E0306EForward declaration does not match the rule implementation signature.Align the two signatures.
E0307ECall site omits a required named-parameter slot binding with no default (D6).Supply the named argument at the call site.
W0308WCurried '(...)' list appended where the rule declares no named slot (D6).Remove the extraneous named-argument list.
E0309ECall site names an identifier not present in the rule's declared named slot (D6).Use only declared named-slot identifiers.

E04 — Structure

Structure module spec/04-structure.md §7. Retains the canonical E04xx block after memory was bumped to E08xx. Related page: structure.html.

CodeSeverityConditionResolution
E0401ESecondary or library module contains 'rule main'.Remove 'rule main' from non-entry modules.
E0402EAccess to an unexported member (missing '.' prefix).Export the member with a '.' prefix or access within module.
E0403EModule file missing from the search path ($pro_mod, $pro_lib, $bee_lib).Place the module in a configured search path.
E0404ECircular dependency between imported modules.Break the import cycle.
E0405EAttempt to load 'main.bee' via a 'use' directive.Do not import the entry module.
E0406EScope exited with pending 'begin' threads prior to a 'wait' barrier.Add a 'wait' barrier before scope exit. (Semantic twin of E1201 in concurrency; retained here for module-level structure completeness.)

E05 — Types

Types module spec/05-types.md §7. Related page: types.html.

CodeSeverityConditionResolution
E0501EAssigned value violates the static type boundary.Cast or fix the value to the declared type.
E0502EIncompatible explicit cast with the ':>' operator.Use a lossless cast between compatible types.
E0503EAssigned literal falls outside a constrained range/domain.Constrain the value to the declared domain.
E0504EValue exceeds the maximum capacity of a Q(m.n) container.Widen the fixed-point precision.
E0505EUser type identifier uses a reserved single uppercase Latin letter.Choose a non-reserved name or a multi-letter type.
E0506EApproximate comparison '≈' executed with uninitialized $max_precision.Initialize $max_precision before using '≈'.

E06 — Objects

Objects module spec/06-objects.md §7. Related page: objects.html.

CodeSeverityConditionResolution
E0601EConcrete class fails to supply a body for an inherited abstract method.Implement the abstract method in the concrete class.
E0602EAccess to a property without the '.' or 'self.' export prefix.Export the property or access via 'self.'.
E0603EDerived constructor fails to execute a 'super(...)' call.Chain the parent constructor.
E0604EClass hierarchy contains a circular inheritance loop.Break the inheritance cycle.
E0605EAccessing a dynamic key that does not exist in an object dictionary.Guard the key with a membership check.
E0606ETrait applied to an incompatible target type.Apply the trait only to compatible types.

E07 — Functions

Functions module spec/07-functions.md §7. Related page: functions.html.

CodeSeverityConditionResolution
E0701ELambda attempts to invoke a stateful rule.Use only pure lambdas inside a lambda; hoist the rule call out.
E0702ELambda contains I/O or variable mutation.Keep lambdas side-effect-free.
E0703EPassed lambda signature does not match the expected 'L' parameter.Align the lambda signature with the 'L' type descriptor.
E0704ELambda references an outer variable not in scope inside the lambda frame.Pass needed values as lambda parameters.
E0705EUse of 'new', 'let', or 'alter' inside a lambda.Move state declarations outside the lambda.

E10 — Collections

Collections module spec/10-collections.md §5. Related page: collections.html.

CodeSeverityConditionResolution
E1001EIndex less than 1 or greater than the collection length '$'.Use 1-based indexing; '$-k' for end-relative.
E1002EInsertion of a duplicate key/element into Set/Map.Check membership or allow overwrite.
E1003EIncompatible row/column dimension during assignment.Align matrix dimensions.
E1004EValue type does not match the declared collection element type.Cast the value or change the element type.
E1005ESet operator ('∩','∪') applied to a non-set type.Use set operators only on sets.
E1006EUse of index 0 (Bee is 1-based, Decision 1).Rewrite the index starting from 1.

E11 — Processing

Processing module spec/11-processing.md §7. Related page: processing.html.

CodeSeverityConditionResolution
E1101EUnboxing a reference into an incompatible scalar type.Unbox with the correct 'Type(boxed)' target.
E1102EQuantifier applied to a non-collection operand.Apply quantifiers to collections only.
E1103EOutput type of a pipeline step does not match the next step's input.Insert an adapting step into the pipeline.
E1104ENumber of targets exceeds collection elements without a '*' tail.Add a '*' tail or reduce targets.
E1105EDimension wildcard '*' used on a non-matrix or invalid rank.Use '*' only on valid matrix ranks.
E1106EReference assignment ':=' on an unboxed value.Box the value first with '[x]'.

E12 — Concurrency

Concurrency module spec/12-concurrency.md §7. Related page: concurrency.html.

CodeSeverityConditionResolution
E1201EScope exited with pending 'begin' threads prior to a 'wait' barrier.Add a 'wait' barrier before scope exit. (Canonical working code; twin of E0406 in structure.)
E1202EDirect cross-thread mutation without a '+>' reduction channel.Use the '+>' reduction channel.
E1203E'yield var << task' on a closed or finished coroutine.Re-open the channel or check coroutine state.
E1204EUnhandled exception in a worker thread surfaced at the 'wait' barrier.Inspect the '$trial' handle and handle the re-raise.
E1205E'yield' used inside a non-coroutine static rule.Declare the rule as a coroutine or remove 'yield'.

E13 — Graphics

Graphics module spec/13-graphics.md §7. Related page: graphics.html.

CodeSeverityConditionResolution
E1301EMalformed degree/minute/second ('° ′ ″') angular syntax.Correct the angular literal.
E1302E'draw' on an unattached or non-existent layer.Attach the layer to the canvas first.
E1303ECircle or polar point constructed with a negative radius r.Use a non-negative radius.
E1304EPolygon constructed with fewer than 3 vertex points.Supply at least 3 vertices.
E1305ETarget canvas hardware context unavailable.Retry with a valid canvas context.

E14 — Library

Library module spec/14-library.md §7. Related page: library.html.

CodeSeverityConditionResolution
E1401ETarget file path missing during an open operation.Create the file or correct the path.
E1402EInsufficient OS permissions to open or write a file handle.Fix the permissions.
E1403EScope exited with an unclosed 'F' file handle.Close the handle before scope exit.
E1404ERequested '$bee.sys' submodule not available in the runtime build.Build with the required submodule.
E1405EFile open mode is not 'r', 'w', 'a', or 'rw'.Use one of the four accepted modes.
Registry contract: when a diagnostic is added, register it first in registry/diagnostics.json in the free slot of its module block. If it collides with an existing code, bump the newer use to the next free slot and re-register — never silently reuse an occupied code with different semantics. Keep this page and every per-module diagnostic table in mirror agreement.