Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Diagnostic Codes

Every diagnostic Boruna’s toolchain emits carries a stable E0NN code. Codes are stable forever — never reused, never renumbered. Tools and AI agents may switch on them.

The registry is machine-readable. Query it directly:

boruna lang codes          # human table
boruna lang codes --json   # { "version": 1, "codes": [ ... ] }

Codes appear in boruna lang check --json output as the id field of each diagnostic.

CodeNameCategorySummary
E001lexer-errorlexicalThe source could not be tokenized (invalid character or token).
E002parse-errorsyntaxThe token stream did not form a valid syntax tree.
E003undefined-variablename-resolutionA referenced variable is not defined in scope.
E004undefined-functionname-resolutionA called function is not defined in the module.
E005non-exhaustive-matchpattern-matchingA match expression does not cover all possible cases.
E006unknown-fieldtypeA record field access or construction references an unknown field.
E007capability-violationcapabilityA function performs an effect it does not declare in its capability set.
E008codegen-errorcodegenThe typechecked program could not be lowered to bytecode.
E009type-errortypeAn expression’s type does not match the type required by its context.
E010assign-to-immutabletypeA binding declared without mut (or a parameter or loop variable) is reassigned. A warning today; an error in language version 2.0.

The table above is generated from the same registry the CLI serves (tooling/src/diagnostics/registry.rs). A drift test asserts the registry stays 1:1 with the E0NN constants the compiler emits.