envzn
0.8 · beta · not released

Diagnostics

Every error and warning the compiler can report: 607 errors and 72 warnings, read from the compiler's own catalog at every build. Each code has its own address, diagnostics.html#E2080, and the search box finds any code by number.

An error stops the build; a warning does not. Every entry gives the message the compiler prints, how to fix it, and the part of the Constitution that sets the rule.

E1000–E1999

119 codes · mostly parse, analyzer, reference

E1001parse:declaration

expected a type declaration at top level

Fix
CLASS App { METHOD start(String[] argv) RETURNS (int32 code) { } }

Constitution I.E

E1002parse:literal

Unterminated char literal — missing closing quote

Fix
char c = 'a'

Constitution I.C

E1003parse:lexer

Unexpected character — not a valid token

Fix
int32 x = 5 + 3

Constitution I.C

E1005parse:assignment

expected an assignment operator — `=`, `:=`, or `=@`

Fix
// insert the operator: `=` value · `:=` ownership · `=@` reference

Constitution I.G

E1006parse:exception

expected 'as' after error type in CATCH

Fix
CATCH (IOException as e) { }

Constitution I.M

E1007parse:status

Expected SUCCESS, FAILURE, or PARTIAL_SUCCESS after IS

Fix
IF result IS SUCCESS { }

Constitution I.M

E1008parse:class-body

Unexpected token in class body

Fix
CLASS Foo { int32 x
  METHOD run() { } }

Constitution I.K

E1009parse:expression

Unexpected token in expression

Fix
int32 x = 2 * 3

Constitution I.F

E1011parse:method-sig

method signature — expected a parameter list

Fix
METHOD run() { }

Constitution I.K

E1012parse:eof

unexpected end of file

Fix
CLASS Foo { }

Constitution I.E

E1013parse:when

Expected colon after WHEN pattern

Fix
WHEN Status s: { }

Constitution I.H

E1014parse:identifier

Expected identifier here

Fix
CLASS MyClass { }

Constitution I.E

E1015parse:type

Expected type reference here

Fix
METHOD run() RETURNS (int32 result) { }

Constitution I.D

E1018parse:params

Unexpected token in method parameter list

Fix
METHOD run(int32 x) { }

Constitution I.K

E1019parse:keyword

Reserved keyword used as identifier

Fix
int32 myClass = 5

Constitution I.E

E1020parse:underscore

leading '_' is reserved for compiler identifiers

Fix
int32 count = 0

Constitution I.E

E1021parse:enum-case

Invalid ENUM case syntax

Fix
ENUM Color { RED, GREEN, BLUE }

Constitution I.K

E1022parse:for

Invalid FOR loop syntax

Fix
FOR i = 0 TO 10 { }

Constitution I.H

E1023parse:lambda

lambda needs a parameter list or block

Fix
String[] items = items->filter(LAMBDA x: x.length() > 0)

Constitution I.F

E1024parse:duplicate-field

Duplicate field declaration in class body

Fix
CLASS Foo { int32 x
  int32 y }

Constitution I.K

E1025parse:match

invalid MATCH — expected target or brace

Fix
MATCH value { WHEN 1: { } }

Constitution I.H

E1026parse:semicolon

semicolons are not valid in Envzn

Fix
int32 x = 5
int32 y = 6

Constitution I.G

E1027parse:numeric-literal

numeric literal out of range for type

Fix
uint8 x = 0xFF  // max value for uint8

Constitution I.D

E1028parse:numeric-underscore

numeric-literal underscore must appear between digits

Fix
int32 x = 1_000

Constitution I.D

E1030parse:loop-syntax

Invalid DO/REPEAT loop — expected condition expression

Fix
DO { work() } REPEAT WHILE cond

Constitution I.H

E1031parse:optional-suffix

'?' is not valid in a declaration

Fix
String name = EMPTY

Constitution I.D

E1032parse:grammar

source does not match the grammar here

Fix
METHOD run() RETURNS (int32 code) { }

Constitution I.E

E1033parse:non-ascii-identifier

identifier must be ASCII letters, digits and underscore only

Fix
int32 cafe = 1   // Unicode is welcome in strings and comments, not in names

Constitution I.C

E1034parse:octal-literal

octal literal is not supported

Fix
int32 legacy = 493        // decimal, or 0x1ED in hex

Constitution I.C

E1080parse:constant-modifier

CONSTANT composes only with PRIVATE, SHARED, INTERNAL

Fix
PRIVATE CONSTANT int32 LIMIT = 1024

Constitution I.K

E1081parse:constant-no-init

CONSTANT field requires an initializer (`= <literal>`)

Fix
CONSTANT float64 PI = 3.14159

Constitution I.K

E1082parse:constant-not-literal

CONSTANT initializer must be a literal

Fix
CONSTANT int32 N = 6

Constitution I.K

E1083parse:constant-bad-type

CONSTANT allowed only on primitives and String

Fix
// CONSTANT supports primitives + String only; use a regular field for class types

Constitution I.K

E1084parse:constant-type-mismatch

CONSTANT initializer type mismatches the field

Fix
CONSTANT String N = "hello"   // or CONSTANT int32 N = 42

Constitution I.K

E1085parse:self-reserved

SELF is a reserved word here

Fix
// Access fields via `.field`, call sibling methods bare (`->iterator()`),
// and pass receiver-anchored handles via `.field` rather than SELF

Constitution I.K

E1086parse:constant-fixed-size-mismatch

CONSTANT array initializer count mismatches its size

Fix
PRIVATE CONSTANT uint8[4] masks = [ 0xFF, 0x7F, 0x3F, 0x1F ]

Constitution I.K

E1090parse:cf-bare-needs-marker

simple conditional needs parentheses or THEN/DO

Fix
Add `THEN`/`DO`: `IF x > 5 THEN { ... }`

Constitution I.H

E1091parse:cf-compound-needs-clause-parens

mixed-operator clauses must be parenthesized

Fix
IF (x > 5) AND (y < 0) { ... }    // or, atomic: IF readyA AND readyB { ... }    // or, same-op chain: IF a AND b AND c { ... }

Constitution I.H

E1095parse:when-implements-missing-else

WHEN T IMPLEMENTS X requires both branches

Fix
WHEN T IMPLEMENTS Cloneable {
    .data->insert(value->clone())
} ELSE {
    .data->insert(value)
}

Constitution I.K

E1096parse:when-implements-bad-T

WHEN T IMPLEMENTS needs a parameterised class

Fix
CLASS Probe[T] {
    METHOD m() { WHEN T IMPLEMENTS Cloneable { } ELSE { } }
}

Constitution I.K

E1097parse:when-implements-unknown-interface

WHEN T IMPLEMENTS X names no INTERFACE

Fix
// Use a declared INTERFACE name (Cloneable, Hashable, Equatable, etc.)

Constitution I.K

E1098analyzer:modify-contract-violation

modifying a data field from a non-MODIFY method

Fix
MODIFY METHOD increment(int32 by) {     // mark MODIFY
    .count->set(.count->valueClone() + by)
}

Constitution I.K

E1099parse:singleton-not-on-class

SINGLETON may only be applied to CLASS

Fix
SINGLETON CLASS Math { CONSTANT float64 PI = 3.14159 }

Constitution I.K

E1100analyzer:singleton-data-field

SINGLETON CLASS declares a data field

Fix
NAMESPACE Config {
    CONSTANT int32 BASE = 10
}

Constitution I.K

E1101analyzer:singleton-modify-method

SINGLETON CLASS methods may not be MODIFY

Fix
SINGLETON CLASS System {
    METHOD exit(int32 code) { ... }
}

Constitution I.K

E1102analyzer:singleton-inheritance

a SINGLETON CLASS may neither inherit nor be inherited

Fix
SINGLETON CLASS System { METHOD exit(int32 code) { ... } }
CLASS Daemon { /* compose, do not inherit */ }

Constitution I.K

E1103analyzer:singleton-init-declared

SINGLETON CLASS may not declare INIT()

Fix
SINGLETON CLASS Math {
    CONSTANT float64 PI = 3.14159
}

Constitution I.K

E1104analyzer:when-type-kind-mismatch

WHEN keyword mismatches the type's kind

Fix
WHEN shape IMPLEMENTS Drawable { } ELSE { }

Constitution I.K

E1105analyzer:when-is-group-unsupported-v1

WHEN IS <Group> requires a local group

Fix
WHEN T IMPLEMENTS Collectable { } ELSE { }  // or test a concrete class / PRIMITIVE

Constitution I.K

E1106analyzer:namespace-arrow-method

NAMESPACE methods use `.`, not `->`

Fix
Math.sqrt(2.0)

Constitution I.N

E1107analyzer:namespace-variable-field

NAMESPACE may declare only CONSTANT fields

Fix
NAMESPACE Counter {
    CONSTANT int32 BASE = 10
    METHOD bump() RETURNS int32 { RETURN (BASE) }
}

Constitution I.N

E1108analyzer:namespace-modify-method

NAMESPACE method may not be declared MODIFY

Fix
NAMESPACE Util {
    METHOD f() {}
}

Constitution I.N

E1109analyzer:namespace-scope-resolution

NAMESPACE members use `.`, not `::`

Fix
Math.PI

Constitution I.N

E1111syntax:reference-requires-rebind-op

REFERENCE assignment requires `=@`

Fix
REFERENCE T value =@ iter->next()

Constitution I.I

E1112analyzer:iterator-as-field

an iterator-implementing class cannot be a data field

Fix
Use the iterator as a method-local

Constitution I.J

E1113analyzer:iterator-class-fields

an iterator-implementing class cannot have class-typed data fields

Fix
CLASS MyIter IMPLEMENTS Iterator OF Token {
    PRIVATE REFERENCE Token cached    // OK — REFERENCE
    PRIVATE int32 cursor               // OK — primitive
}

Constitution I.J

E1114syntax:reference-optional-banned-2.0

a REFERENCE may not be marked absent with `?`

Fix
METHOD at(int32 i) RETURNS (REFERENCE Token t | STATUS s)

Constitution I.I

E1115syntax:mutable-reference-field-banned

MUTABLE REFERENCE forbidden on an instance field

Fix
CLASS Fleet { INTERNAL REFERENCE Widget active }

Constitution I.I

E1116parse:bitwise-comparison-mix

bitwise and comparison operators need parenthesized grouping

Fix
IF ((value BAND mask) == 0) { ... }    // or IF (value BAND (mask == 0)) { ... } if that's the intent

Constitution I.H

E1117parse:class-leader-inside-block

class-level declaration inside a method body

Fix
// add the missing `}` between REPEAT (4) { … and RETURN (0):
METHOD a() {
    REPEAT (4) {
        // ...
    }                       // <- the missing close
    RETURN (0)
}

Constitution I.H

E1118parse:nesting-too-deep

Source nesting exceeds the parser's maximum

Fix
int32 x = (a + b) * c    // keep nesting shallow

Constitution I.G

E1119analyze:definite-return

non-void method can fall through without RETURN

Fix
METHOD pick(int32 x) RETURNS int32 { IF (x > 0) THEN { RETURN (x) } ELSE { RETURN (0) } }

Constitution I.K

E1120reference:init-bad-op

REFERENCE field assigned with the wrong operator

Fix
INIT(Widget w) { .target =@ w }

Constitution I.I

E1121reference:init-unassigned

REFERENCE field not bound with =@

Fix
CLASS Holder { REFERENCE Widget w  INIT(Widget src) { .w =@ src } }

Constitution I.I

E1122reference:rebind-non-ref

=@ used on a non-REFERENCE field

Fix
INIT(Widget src) { .w := src }

Constitution I.I

E1123parse:continuation-layout

a continuation keyword after a multi-line block must start its own line

Fix
IF (c) THEN {
    a()
}
ELSE {   // ELSE on its own line (a one-line block may still cuddle)

Constitution I.C

E1124analyzer:method-dot-access

methods are reached with `->`, never `.`

Fix
widget->equals(other)     // `->` is the method call

Constitution I.F.i

E1130hidden:no-interface

HIDDEN class must IMPLEMENTS or EXTENDS abstract

Fix
HIDDEN CLASS ChainedHashDictionary[K, V, H] IMPLEMENTS Dictionary[K, V, H] { ... }

Constitution I.K

E1131hidden:used-as-type

HIDDEN class name only a CREATE target

Fix
Dictionary[K, V, H] d := CREATE ChainedHashDictionary[K, V, H](...)

Constitution I.K

E1132analyzer:value-class-inheritance

a VALUE CLASS may neither inherit nor be inherited

Fix
VALUE CLASS Point IMPLEMENTS Equatable { }
CLASS Pixel { /* compose, do not inherit */ }

Constitution I.K

E1133analyzer:value-class-interface-box

VALUE CLASS cannot sit behind an interface

Fix
Point c := CREATE Point()       // hold the concrete value type

Constitution I.K

E1134analyzer:value-class-uncopyable-field

VALUE CLASS field cannot be copied; use CLASS

Fix
CLASS Guard {
    _cxxmutex lock          // a reference type: held, never copied
}

Constitution I.K

E1135ndarray:malformed-spec

N-D array axes must be all-empty or all-sized

Fix
float64[m,n]                              // all axes sized (runtime shape)

Constitution I.J

E1136discard:as-argument

`$?` is a return-discard, not a call argument

Fix
obj->foo(x)                               // pass a real value; $? only discards a return

Constitution I.M

E1137discard:as-parameter

`$?` is not a valid parameter name

Fix
METHOD foo(LogLevel level)                // name it (unused is fine) or drop the param

Constitution I.M

E1138discard:nothing-to-discard

`$?` discards a call result; RHS is not a call

Fix
$? := out->append(x)                      // discard a call's return

Constitution I.M

E1139parse:lowercase-keyword

statement keywords are UPPERCASE — this parses as an undefined function call

Fix
IF (x > 3) THEN { printline("big") }      // keywords are uppercase

Constitution I.H

E1140parse:status-in-comma-return

STATUS cannot be a comma member

Fix
METHOD find(int32 key) RETURNS (int32 value | STATUS status)

Constitution I.M

E1141parse:internal-modifier

INTERNAL applies only to a concrete type or its field

Fix
INTERNAL CLASS Shape { }   // concrete class, enum, or struct

Constitution I.E

E1142reference:mutable-not-standalone

MUTABLE qualifies REFERENCE — it is not standalone

Fix
MUTABLE REFERENCE int32 count

Constitution I.I

E1143reference:not-applicable-here

REFERENCE does not apply to this declaration

Fix
int32 slot             // drop the REFERENCE prefix

Constitution I.I

E1144reference:shape-conflict

REFERENCE combined with an incompatible qualifier

Fix
MUTABLE REFERENCE Node peer   // pick one reference shape

Constitution I.I

E1145template:malformed-qualifier

malformed TEMPLATE qualifier

Fix
TEMPLATE: GIVEN TYPE T IS Cloneable:

Constitution I.K

E1146template:constraint-mismatch

each declared type parameter needs exactly one constraint

Fix
TEMPLATE: GIVEN TYPES K, V IS K Cloneable, V Cloneable:

Constitution I.K

E1147template:singular-form

plural form used for a single item

Fix
TEMPLATE: GIVEN TYPE T IS Cloneable:

Constitution I.K

E1148template:qualifier-placement

TEMPLATE qualifier must sit on a generic declaration

Fix
TEMPLATE: GIVEN TYPE T IS Cloneable:
FINAL CLASS Box[T] { }

Constitution I.K

E1149loop:hotloop-target

HOTLOOP applies to a counted FOR or a WHILE

Fix
HOTLOOP FOR i = 0 UNTIL items.length { }

Constitution I.H

E1150parse:assert-form

ASSERT needs a one-line condition and a message

Fix
ASSERT(depth < limit) => "depth exceeded the limit"

Constitution I.M

E1151loop:loop-form

LOOP has one form: LOOP e IN c WITH INDEX i

Fix
LOOP row IN orders WITH INDEX i { }   // or, if you do not need i: FOR row IN orders { }

Constitution I.H

E1152parse:returns-label

every slot in a parenthesized RETURNS needs a label

Fix
METHOD divide(int32 a, int32 b) RETURNS (int32 q, int32 r)

Constitution I.K

E1153parse:returns-pipe-shape

a pipe RETURNS is one success tuple, then one STATUS

Fix
METHOD find(int32 k) RETURNS (int32 v | STATUS s)

Constitution I.M

E1154parse:conversions-body

a CONVERSIONS host declares AS/INTO operators

Fix
CONVERSIONS TextConverter { OPERATOR INTO (FROM String) RETURNS ByteBuffer { } }

Constitution I.N

E1155parse:namespace-body

a NAMESPACE holds methods and CONSTANT fields only

Fix
NAMESPACE HexCodec { METHOD toHex(ByteBuffer b) RETURNS String { } }

Constitution I.N

E1156parse:foreign-type-unterminated

FOREIGN_TYPE reached end of file with no closing paren

Fix
FOREIGN_TYPE (struct sqlite3)

Constitution I.N

E1157parse:match-type-subject

a type-check MATCH subject must be a simple variable

Fix
Shape s =@ shapes[i]
MATCH s { WHEN IS Circle: { } }

Constitution I.H

E1158parse:match-type-arm-form

a type-check MATCH arm names a type after IS or IMPLEMENTS

Fix
MATCH s { WHEN IS Circle: { } }

Constitution I.H

E1159analyzer:value-class-array-no-default

a VALUE CLASS array element needs an INIT()

Fix
VALUE CLASS Money { INIT() { … }  INIT(decimal128 a, CurrencyCode c) { … } }

Constitution I.J

E1160parse:when-compiletime-header

compile-time WHEN needs IS or IMPLEMENTS after the name

Fix
WHEN K IMPLEMENTS Equatable[K] { } ELSE { }   // or IS <Type> / IS VALID

Constitution I.K

E1161parse:when-missing-do

this WHEN arm needs DO before its block

Fix
WHEN T IS VALID DO { } ELSE { }

Constitution I.K

E1162parse:when-missing-else

WHEN ... DO requires a mandatory ELSE arm

Fix
WHEN T IS VALID DO { } ELSE { }   // ELSE may be empty

Constitution I.K

E1163parse:reserved-keyword-unimplemented

reserved keyword with no V1 implementation

Fix
FOR x IN items { }                 // FOREACH is reserved for V3 — use FOR … IN

Constitution I.C

E1164parse:keyword-superseded

this keyword spelling has been superseded

Fix
PANIC FileError("x")        // or: UNREACHABLE!  // or: METHOD take(Widget w)

Constitution I.H

E1165parse:brace-single-ambiguous

a lone `{x}` is ambiguous — 1-element set or block

Fix
{ total, }        // a set — or add statements to make it a block

Constitution I.J

E1166parse:set-literal-no-destination

a set literal at statement position has nowhere to go

Fix
Set[int32] s := { a, b, c }   // or drop the commas for a block

Constitution I.J

E1167parse:discard-outside-return

`$?` is valid only as a return discard

Fix
$? := call()        // or: $?, name := f()

Constitution I.M

E1168parse:toplevel-placement

this declaration belongs at the top of the file

Fix
MODULE myLib
ALIAS mda::TextColumn
CLASS Widget { }

Constitution I.N

E1169parse:foreign-modifier-needs-bind

this modifier is valid only on a FOREIGN BIND declaration

Fix
FOREIGN BIND ev_read(int32 fd) SETS_ERRNO(-1)

Constitution I.N

E1170parse:modifier-duplicate

this modifier is given twice

Fix
// remove the repeated modifier — one occurrence is the whole meaning

Constitution I.N

E1171parse:foreign-type-bind-form

FOREIGN_TYPE BIND takes `opaque <Name>` or `(<c++ type>) <Name>`

Fix
FOREIGN_TYPE BIND (std::mutex) Handle   // or: BIND opaque Handle

Constitution I.N

E1172parse:modifier-class-only

this modifier applies only to a CLASS

Fix
HIDDEN CLASS Point { }         // or: VALUE CLASS Point { }

Constitution I.J

E1173parse:value-class-combination

VALUE CLASS is a concrete leaf — it takes neither modifier

Fix
VALUE CLASS Point { }

Constitution I.J

E1174parse:numeric-literal-malformed

this numeric literal is missing or misusing its digits

Fix
0x1F   ·   0b1011   ·   1.5e-3

Constitution I.C

E1175parse:foreign-type-field-form

a FOREIGN_TYPE field binds one non-pointer C++ type

Fix
FOREIGN_TYPE (std::string) name   // a value type, never a pointer

Constitution I.N

E1176parse:status-narrowing-negated

STATUS narrowing takes a positive kind, never IS NOT

Fix
IF s IS SUCCESS THEN { }        // name the kind you want

Constitution I.M

E1177parse:iterator-is-a-method

`iterator` is a method — reach it with `->`, not `.`

Fix
FOR x IN coll->iterator() { }

Constitution I.J

E1178parse:call-on-non-callable

only a name or a field access can be called

Fix
total(a + b, 1)        // call a name, or obj->method(...)

Constitution I.K

E1179parse:fixed-dim-form

a fixed-array dim is an int literal or a CONSTANT name

Fix
float64[2, N] grid        // ROWS is a CONSTANT; 2 is a literal

Constitution I.J

E1180parse:auto-method-form

AUTO applies only to `clone()`, `serialize` and `reconstruct`, with an empty body

Fix
AUTO METHOD clone() { }

Constitution I.J

E1182syntax:shared-field

SHARED on a field is only valid as SHARED MUTABLE REFERENCE

Fix
CLASS Counter { PRIVATE int32 hits }   // SHARED is a CLASS modifier (I.K.ii)

Constitution I.K

E2000–E2999

165 codes · mostly type, foreign, template

E2002type:mismatch

RHS type incompatible with declared type

Fix
int32 x = 42

Constitution I.D

E2005ambiguity:match-form

ambiguous MATCH — EMPTY vs GROUP dispatch

Fix, one of
  1. Add `WHEN EMPTY` — 'cfg' may be absent
  2. GROUP dispatch — Type1/Type2 are variants; code is valid

Constitution I.H

E2007type:narrowing

narrowing conversion requires IS or Convert

Fix
IF bigValue AS int8 THEN { int8 small = $RETURNED }

Constitution I.D

E2009type:reserved-complex

complex_* types are reserved for V2

Fix
// Use float64 for now; complex types arrive in V2

Constitution I.D

E2013type:box-null

Box[T] field accessed before assignment

Fix
Box[Node] next = CREATE Node()
Node n = next.value

Constitution I.J

E2014type:box-optional

Box[T] always holds a value

Fix
Box[Node] next := CREATE Node()   // Box is always present; drop the `?`

Constitution I.J

E2015type:enum-case

Enum case used as wrong type

Fix
Color c = RED

Constitution I.K

E2016type:class-inference

Cannot CREATE a GROUP type

Fix, one of
  1. Assign the variant directly — no CREATE for a GROUP
  2. CREATE a concrete class that belongs to the GROUP

Constitution I.K

E2017type:return-mismatch

returned type does not match declared type

Fix
METHOD getCount() RETURNS (int32 n) { RETURN 5 }

Constitution I.K

E2019type:operator

Operator not valid for this type

Fix
bool result = "hello" == "world"
    int32 r = (n AS int32) % 2      // say which domain the remainder is in

Constitution I.F

E2020type:assignment

String '=' needs a literal RHS

Fix, one of
  1. Use `:=` for a runtime-computed value
  2. Assign a string literal and keep `=`

Constitution I.G

E2021type:arg-type

Argument type does not match parameter type

Fix
print(Convert->toString(42))

Constitution I.K

E2022type:collection-element

collection elements must share one type

Fix
int32[] nums = [1, 2, 3]

Constitution I.J

E2023type:method-on-primitive

cannot call a method on a primitive

Fix
int32 a = 5
String b := Convert->toString(a)   // use the Convert singleton

Constitution I.D

E2024type:non-object

cannot access a member on a non-object

Fix
MyClass x = CREATE MyClass()
int32 y = x.value

Constitution I.K

E2025type:comparison

Incompatible types in comparison

Fix
bool ok = Convert->toString(5) == "five"

Constitution I.F

E2027type:v2-cursor

Cursor[T] is reserved for V2

Fix
// Use Iterator[T] for V1 iteration; Cursor arrives in V2

Constitution I.J

E2028type:v2-stream

Stream[T] is reserved for V2

Fix
CHANNEL[Order] feed

Constitution I.L

E2029type:non-void-discard

expression result discarded — use '$?'

Fix
int32 result := obj->compute(x)
// or discard it: $? := obj->compute(x)

Constitution I.M

E2030type:reserved-v2

this type or interface is reserved for V2

Fix
// This feature is deferred to V2; use supported V1 types

Constitution I.D

E2031type:bitwise-non-integer

bitwise/shift/rotate operators require integer operands

Fix, one of
  1. Convert the operand to an integer first
  2. Use a different (non-bitwise) operator

Constitution I.F

E2032type:incdec-non-numeric

`++`/`--` require a numeric primitive operand

Fix
int32 i = 0
i++

Constitution I.F

E2033type:incdec-non-lvalue

`++`/`--` require an lvalue operand

Fix
int32 sum = a + b
sum++

Constitution I.F

E2034type:setop-non-set

set-algebra operators require Set-typed operands

Fix
// Both sides must be {T}-typed; lift the scalar into a set first

Constitution I.J

E2035type:setop-elem-mismatch

set-algebra operands must share an element type

Fix
// Both sides must be {T} with the same T

Constitution I.J

E2036type:setop-non-cloneable-elem

class-element set algebra requires Cloneable elements

Fix
// Add `IMPLEMENTS Cloneable` (with AUTO METHOD clone() {}) to Token

Constitution I.J

E2037type:dict-key-not-hashable

Dictionary key class needs Hashable + Equatable

Fix, one of
  1. Implement `Hashable` + `Equatable` on the key type
  2. Use a primitive key

Constitution I.J

E2038type:redundant-implements

subclass redeclares an interface its parent provides

Fix
CLASS Dog EXTENDS Animal { ... AUTO METHOD clone() RETURNS Dog { } }

Constitution I.K

E2039type:cloneable-subclass-no-clone

Cloneable subclass must declare its own clone()

Fix
// AUTO METHOD clone() RETURNS Dog { } — synthesised body copies Dog's own fields

Constitution I.K

E2040type:fixed-array-as-param

fixed-size array `T[N]` cannot be a parameter

Fix
Pass an opaque vector `int32[]`

Constitution I.J

E2041type:fixed-array-as-return

fixed-size array `T[N]` cannot be returned

Fix
Return an opaque vector `int32[]`

Constitution I.J

E2042type:fixed-array-bound-unresolved

fixed-array bound: int literal or CONSTANT

Fix
Use an integer literal: `int32[9] arr`

Constitution I.J

E2043type:fixed-array-bound-non-integer

a fixed-array bound CONSTANT must be an integer type

Fix
CONSTANT int32 LIST_MAX = 9
int32[LIST_MAX] arr

Constitution I.J

E2044type:fixed-array-bound-non-positive

fixed-array bound must be a positive integer

Fix
int32[4] arr   // any int literal >= 1

Constitution I.J

E2045type:fixed-array-size-cap

Fixed-size array bound exceeds 32768

Fix
Token[] tokens         // opaque, heap-managed
// or shrink the size to <= 32768 if it really must be fixed

Constitution I.J

E2046type:fixed-array-whole-assign

whole-array `:=` is not allowed on a fixed-size array

Fix
// Cell-by-cell:
FOR i = 0 UNTIL 4 { copy[i] := original[i] }
// Or:
REFERENCE int32[4] handle =@ original

Constitution I.J

E2047type:fixed-array-whole-bind-not-reference

Whole-array `=@` requires a `REFERENCE T[N]` LHS

Fix
REFERENCE int32[4] alias =@ original

Constitution I.J

E2048type:fixed-array-cell-bind-owning

cell-level `=@` forbidden on an owning fixed-array

Fix
arr[i] := someToken             // clone-into the cell
arr[i] = CREATE Token(...)      // construct a fresh instance

Constitution I.J

E2049type:fixed-array-element-not-cloneable

cell-level `:=` on a class fixed-array requires Cloneable elements

Fix
// Make Token IMPLEMENTS Cloneable (with AUTO METHOD clone()) or assign via CREATE

Constitution I.J

E2050type:atomic-bad-T

Atomic[T] requires a lock-free primitive T

Fix
// Use a lock-free primitive: Atomic[boolean], Atomic[int32],
// Atomic[uint64], Atomic[char], Atomic[binary], etc.
// For larger compound state, wrap with a Mutex instead.

Constitution I.K

E2051type:undefined-variable

name resolves to no in-scope binding

Fix
int32 x = 0                       // declare/spell the variable correctly

Constitution I.G

E2052return:missing-value

value-returning method hit a bare RETURN

Fix
METHOD get() RETURNS STATUS { RETURN (SUCCESS) }

Constitution I.G

E2053return:arity-mismatch

RETURN value count differs from the declaration

Fix
METHOD f() RETURNS (STATUS s, int32 n) { RETURN (SUCCESS, 5) }

Constitution I.G

E2054type:cxx-noncopyable

_cxx* type cannot be copied, moved, stored

Fix
// Pass by REFERENCE or `&`; declare a single field per owner;
// share access through method calls on the owning class

Constitution I.K

E2055type:cxx-no-method

_cxx* reserved type has no such method

Fix
// _cxxmutex methods: lock, unlock, tryLock
// _cxxcondvar methods: wait, waitFor, notifyOne, notifyAll
// _cxxrawthread methods: spawn, join, isJoinable, detach
// _cxxatomic[T] methods: load, store, compareExchange
// _cxxsetiter[T] methods: init, advance, isEnd, value
// _cxxmapiter[K, V] methods: init, advance, isEnd, key

Constitution I.K

E2056type:index-non-indexable

subscript [...] applied to a non-indexable scalar primitive

Fix
int32[] a = [5, 6]
int32 b = a[0]      // index an array

Constitution I.J

E2057type:create-arg-mismatch

CREATE argument count matches no INIT

Fix
Main m = CREATE Main(args)   // pass the required INIT arguments

Constitution I.K

E2058type:cxx-condvar-bad-mutex-arg

_cxxcondvar.wait() / .waitFor() requires a _cxxmutex argument

Fix
// Pass the partner _cxxmutex as the first argument:
// cv->wait(.m)
// cv->waitFor(.m, millis)

Constitution I.K

E2059type:cxx-atomic-bad-T

_cxxatomic[T] requires a lock-free primitive T

Fix
// Use a lock-free primitive: _cxxatomic[boolean], _cxxatomic[int32],
// _cxxatomic[uint64], _cxxatomic[char], _cxxatomic[binary], etc.

Constitution I.K

E2060type:op-no-method

this operator on a class requires the matching `OPERATOR`

Fix
ByteBuffer c := bb1->concat(bb2)   // explicit named method

Constitution I.F

E2061type:op-arith-class-unsupported

this operator is not overloadable on a class

Fix
Matrix m := a->negate()   // use a named method

Constitution I.F

E2062type:print-builtin-arity

wrong argument count to a print builtin

Fix
formatPrintline("{0} {1}", "hello", 5)   // template + args

Constitution I.G

E2063type:storage-noncopyable

storage shorthand cannot be copied or moved

Fix
// Wrap in a class and pass the wrapper, or expose the
// elements through the wrapper API (insert / size / etc).

Constitution I.J

E2064type:storage-visibility

storage shorthand may only be INTERNAL or PRIVATE

Fix
// Add INTERNAL (module-private) or PRIVATE (class-private):
// INTERNAL T[] data

Constitution I.J

E2065type:storage-positional-on-set

positional operations invalid on a set {T}

Fix
// {T} methods: insert, erase, clear, size, count.
// Use Set[T] (the wrapper) for iterator-based traversal.

Constitution I.J

E2066type:storage-no-method

Storage shorthand has no such method

Fix
// T[] (value-array, blittable T): .length, .capacity, clear, [i] (HWM-write proxy), iterator. Use Array[T] for richer methods.
// T[] (std::vector-backed, kernel-internal): also insert, insertAt, erase, eraseAt, size, count.
// {T} methods: insert, erase, clear, size, count.
// {K: V} methods: clear, insert, insertCopy, lookup, lookupReference, remove, contains.

Constitution I.J

E2068type:clone-without-cloneable

class declares clone() but not IMPLEMENTS Cloneable

Fix
CLASS Foo IMPLEMENTS Cloneable { METHOD clone() RETURNS Foo { ... } }

Constitution I.K

E2069type:eq-on-class

`==`/`!=` on classes is unsupported (V1)

Fix
IF a->equals(b) THEN { ... }
IF NOT a->equals(b) THEN { ... }

Constitution I.F

E2070type:opaque-not-parametric

`opaque` is not a parametric type

Fix
opaque d := opaque[Esquire]->wrap(myEsquire)

Constitution I.D

E2071type:opaque-bare-in-expr

Bare `opaque` is not a value

Fix
opaque d := opaque[Esquire]->wrap(myEsquire)

Constitution I.D

E2072type:opaque-static-call-required

opaque[T] must be followed by ->wrap or ->unwrap

Fix
opaque d := opaque[Esquire]->wrap(myEsquire)

Constitution I.D

E2073type:destructure-count-mismatch

multi-assign binds a different number of names than the call returns

Fix
int32 x, int32 y := p->two()

Constitution I.G

E2074type:create-arg-type

CREATE argument type does not match the INIT parameter

Fix
Widget w = CREATE Widget(7)

Constitution I.K

E2075type:rebind-non-class-source

=@ source must be a valid place

Fix
// =@ binds a place: a variable, a field, an indexed access, or a REFERENCE-returning call
REFERENCE int32 r =@ count

Constitution I.I

E2076memory:cleanup-self-reference-read

SELF REFERENCE field in CLEANUP is EMPTY

Fix
CLEANUP { /* do not read self-REFERENCE fields here */ }

Constitution I.I

E2077return:void-returns-value

a VOID method cannot return a value

Fix
METHOD log() RETURNS VOID {
    RETURN              // bare RETURN exits a VOID method
}

Constitution I.G

E2078type:opaque-instance-method-call

method called on an opaque value

Fix, one of
  1. Unwrap the value into a local or field, then call the method on it
  2. On the opaque itself, call only loaded() or clone()

Constitution I.D

E2079init:class-field-unassigned

every class-typed field needs INIT assignment

Fix
CLASS Stack[T] {
    PRIVATE Array[T] data
    INIT() {
        .data := CREATE Array[T]()
        .length = 0
    }
}

// Or, for intentionally-empty initial state:
CLASS LinkedListNode[T] {
    T value
    LinkedListNode[T] next
    INIT(uint64 id) {
        .id = id
        .value = EMPTY     // explicit
        .next = EMPTY      // explicit
    }
}

Constitution I.K

E2080null-safety:variable-may-be-empty

class-typed variable not provably non-EMPTY

Fix
IF .next IS VALID THEN { .next->doSomething() }

Constitution I.D

E2081null-safety:pipe-success-slot-unpopulated

pipe success path may leave the value slot unpopulated

Fix
METHOD next() RETURNS (REFERENCE T value | STATUS s) {
    IF .cursor.id == 1 THEN { s = FAILURE("end"); RETURN(s) }
    value =@ .cursor.value
    RETURN(value)
}

Constitution I.M

E2082null-safety:return-slot-unpopulated

method RETURNS T may leave the named slot unpopulated

Fix
METHOD build() RETURNS Builder result {
    result := CREATE Builder()
    IF .ready THEN { result->prepare() }
    RETURN(result)
}

Constitution I.D

E2083type:invalid-collection-boolean

boolean cannot be a kernel-collection element/key/value

Fix
Array[uint8] flags := CREATE Array[uint8]()

Constitution I.K

E2084type:power-non-numeric

the power operator `^` requires numeric operands

Fix
int32 n := 2 ^ 10     // numeric base and exponent

Constitution I.F

E2085type:factorial-non-integer

the factorial operator `!` requires an integer operand

Fix
int64 n := 5!         // 120

Constitution I.F

E2086conversion:no-such-conversion

no conversion operator for this source/target pair

Fix
String s = count INTO String // a declared NumberConverter conversion

Constitution conversion-operators-design.md

E2087conversion:lossless-required

`INTO` needs a lossless conversion; use `AS`

Fix
int32 i, STATUS s := ... ; IF (pi AS int32) { i = $RETURNED }

Constitution conversion-operators-design.md

E2088conversion:duplicate-pair

conversion operator already declared for this pair

Fix
Keep a single OPERATOR for each (source -> target) pair; delete or merge the duplicate.

Constitution conversion-operators-design.md

E2089conversion:orphan-rule

CONVERSIONS operator declarable only by the owner

Fix
Declare the conversion in the module that defines the source or target type, or convert via a type your module owns.

Constitution conversion-operators-design.md

E2090foreign:non-boundary-param

FOREIGN BIND parameter type cannot cross boundary

Fix
FOREIGN BIND f(ByteBuffer buf) RETURNS int32

Constitution II.L

E2091foreign:non-boundary-return

FOREIGN BIND return cannot cross the boundary

Fix
FOREIGN BIND f() RETURNS int32

Constitution II.L

E2092foreign:bytebuffer-return

ByteBuffer is parameter-only across a FOREIGN BIND

Fix
FOREIGN BIND read(int32 fd, ByteBuffer buf) RETURNS int64

Constitution II.L

E2093foreign:owned-non-string

owned-return marker applies to String, String[] and Dictionary[String, String, H] returns only

Fix
FOREIGN BIND f() RETURNS String $*

Constitution II.L

E2094foreign:sets-errno-shape

SETS_ERRNO must declare its pipe: RETURNS (T value | STATUS status)

Fix
FOREIGN BIND open(String p, int32 f, int32 m) RETURNS (int32 fd | STATUS status) SETS_ERRNO(-1)

Constitution II.L

E2095foreign:constant-non-integer

FOREIGN BIND CONSTANT binds one C integer

Fix
FOREIGN BIND CONSTANT int32 O_RDONLY

Constitution II.L

E2096foreign:struct-non-boundary-field

FOREIGN BIND STRUCT needs all boundary-typed fields

Fix
STRUCT R { int32 count
  int64 checksum }

Constitution II.L

E2097foreign:conflicting-redeclaration

FOREIGN BIND name redeclared with different signatures

Fix
// declare open(...) with one identical signature in each file

Constitution II.L

E2098type:value-array-non-blittable-element

value-array element type is not blittable; use Array[T]

Fix
Array[Token] tokens                       // class-typed array — heap with handles

Constitution I.J

E2099type:storage-shorthand-not-array-class

storage shorthand is minimal — use Array

Fix
tmp[tmp.length] = x   // value-array HWM proxy
// or migrate the field to Array[T] for richer collection methods

Constitution I.J

E2100foreign:load-outside-bind

`LOAD` is a FOREIGN BIND parameter modifier

Fix
Move the declaration into a `FOREIGN BIND`

Constitution II.L

E2101foreign:load-ineligible-type

LOAD admits only a value-array parameter

Fix
FOREIGN BIND f(LOAD char8[] buf, int32 maxBytes) RETURNS int32

Constitution II.L

E2102foreign:load-arg-not-named-variable

LOAD argument is not a writable target

Fix, one of
  1. Pass a named local, then use it after the call
  2. For a FOREIGN_TYPE handle, LOAD into an `opaque` field inside UNSAFE

Constitution II.L

E2103type:undefined-type

type name resolves to no in-scope type

Fix
CLASS MyClass IMPLEMENTS Cloneable { }       // name a declared interface

Constitution I.E

E2104opaque:bad-static-op

static opaque[T]-> call names neither wrap nor unwrap

Fix
String s := opaque[String]->unwrap(box)    // wrap / unwrap only

Constitution I.D

E2105conversion:lossy-on-lossless

this conversion is lossless — use `INTO`

Fix
char32 c = b INTO char32 // lossless total conversion

Constitution conversion-operators-design.md

E2106conversion:complex-as-real-ambiguous

`complex AS <real>` is an invalid conversion

Fix
float64 f = c.real INTO float64  // pick the projection explicitly

Constitution I.D

E2107alias:unresolved-target

ALIAS names a fully-qualified type that does not exist

Fix
ALIAS Json::JsonWriter       // an existing dep type

Constitution I.G

E2108alias:ambiguous

ALIAS short name collides with a local type or another alias

Fix
ALIAS Json::JsonWriter       // a short name not otherwise declared here

Constitution I.G

E2109foreign:call-undeclared

FOREIGN call has no BIND declaration in this file

Fix
FOREIGN BIND write(int32 fd, binary[] buf, C.size_t n) RETURNS C.ssize_t

Constitution II.L

E2110template:missing-qualifier

templated CLASS is missing its TEMPLATE: GIVEN qualifier

Fix
TEMPLATE: GIVEN TYPE T IS Comparable, PRIMITIVE (EXCEPT opaque, boolean):
CLASS Array[T] { ... }

Constitution I.K

E2111template:unknown-atom

template qualifier names a type that does not resolve

Fix
TEMPLATE: GIVEN TYPE T IS Comparable:

Constitution I.K

E2112template:except-on-non-group

`EXCEPT (...)` follows only GROUP or PRIMITIVE

Fix
Replace the bound with a GROUP that lists its members

Constitution I.K

E2113template:except-bad-member

EXCEPT name is not a GROUP member

Fix
TEMPLATE: GIVEN TYPE T IS Collectable (EXCEPT Dictionary):

Constitution I.K

E2114template:type-arg-violates-qualifier

type argument does not satisfy the template's qualifier

Fix
Array[int32]     // int32 is in PRIMITIVE and not excepted

Constitution I.K

E2115shared-class:not-shareable

A SHARED CLASS must `IMPLEMENTS Shareable`

Fix
SHARED CLASS Channel[T] IMPLEMENTS Shareable { ... }

Constitution I.K

E2116shared-class:field-not-private

SHARED CLASS data fields must be PRIVATE

Fix
SHARED CLASS Channel[T] { PRIVATE int32 depth ... }

Constitution I.K

E2117shared-ref:referent-not-shared-class

SHARED MUTABLE REFERENCE requires a SHARED CLASS

Fix
SHARED MUTABLE REFERENCE Channel[T] ch   // Channel is a SHARED CLASS

Constitution I.I

E2118type:complex-no-ordering

ordering operators are not defined on `complex` or `boolean`

Fix
IF a.magnitude() < b.magnitude() THEN { }
    IF ready AND NOT done THEN { }         // say which combination you mean

Constitution I.D

E2119type:approx-non-numeric

the `≈` / `≉` operators require numeric operands

Fix
boolean b = x ≈ 3.0     // numeric operands

Constitution I.F

E2120type:complex-literal-unparenthesized

a two-part complex literal must be parenthesized

Fix
complex z = scale * (3 + 4im) // parenthesized; or bare RHS: z = 3 + 4im

Constitution I.C

E2121type:decimal-not-clean

a `decimal128` operand needs a `decimal128` or ≤64-bit-integer counterpart

Fix
decimal128 rate = 0.05          // keep both decimal128 (literals are exact)
    // or unwrap a conversion first: IF (rate INTO decimal128) THEN { ... }

Constitution I.D

E2122ndarray:rank-mismatch

N-D array subscript needs one index per axis

Fix
a[i, j]       // one coordinate per axis

Constitution I.J

E2123ndarray:invalid-dimension

N-D array fixed extent must be positive

Fix
float64[3,4] tile                         // every fixed extent >= 1

Constitution I.J

E2124ndarray:chained-bracket-retired

chained T[N][M] is retired; use T[N,M]

Fix
int32[3,4] grid                           // comma form: a dense column-major N-D array

Constitution I.J

E2125ndarray:arithmetic-shape-mismatch

N-D arithmetic operands must have the same shape

Fix
float64[,] r := a + b      // a and b same rank (and same dims for fixed forms)

Constitution I.J

E2126type:recovery-provably-wrong

recovery to a provably-wrong concrete type

Fix
Retriever r := a     // recover to the concrete type flow proved

Constitution I.J

E2128ndarray:fixed-to-spine-arg

a fixed-shape N-D array cannot pass as a runtime-shape one

Fix
float64[,] m := fixed  Nd.sum(m)   // bind to a float64[,] first (or declare the parameter `REFERENCE float64[,]`)

Constitution I.J

E2129type:type-args-non-generic-method

method takes no type arguments

Fix
p := c->parse(t)           // drop the type arguments

Constitution I.K

E2130shift:count-out-of-range

shift count exceeds operand bit width

Fix
int64 b = a LSHIFT 40                     // widen the operand, or shift less

Constitution I.F

E2131shift:bare-literal-operand

bare integer literal shifts at int32 width

Fix
uint64 one = 1  →  uint64 mask = one LSHIFT p   // give the literal its type

Constitution I.F

E2132ndarray:object-element-arithmetic

whole-array arithmetic needs a numeric element type

Fix
FOR (i, j) IN a { … }      // walk the cells; `+`/`-`/`*` are numeric-element only

Constitution I.J

E2133type:type-args-arity

wrong number of type arguments for this method

Fix
v := Codec.parse[Person](t)          // supply exactly one

Constitution I.K

E2134arith:wrapping-operand-not-integer

wrapping operators &+ &- &* require fixed-width integer operands

Fix
int64 r = a &* b                       // integer operands wrap mod 2^n

Constitution I.F

E2135octet:scaling

an octet has no multiplication, division, remainder or power

Fix
uint32 scaled = (b INTO uint32) * 2   // widen to a number, then scale

Constitution I.D.i

E2136octet:decimal-literal

an octet is written in hex or binary, not decimal

Fix
binary flag = 0xC3                   // 0xC3 says WHICH BITS (a bare 0 is allowed: 0 == 0x0)

Constitution I.D.i

E2137octet:shift-count-width

the shift count on an octet must be uint8

Fix
uint8 n = 4  →  binary lo = b RSHIFT n   // a count is a uint8 quantity

Constitution I.D.i

E2138foreign:call-arity-mismatch

FOREIGN call argument count differs from its BIND declaration

Fix
FOREIGN::write(fd, buf, n)

Constitution II.L

E2139octet:not-a-number

an octet is not a number — convert it with INTO

Fix
int32 n = (b INTO uint32)      // say which number the bits are read as

Constitution I.D.i

E2140type:identity-not-user-constructible

`Identity` cannot be constructed directly

Fix
Identity id := IDENTITY(person)     // the keyword is the only producer

Constitution I.K.iii

E2141type:identity-unknown-subject

IDENTITY subject is not a value or type

Fix
IDENTITY(person)  // a value, a type, a type-parameter, or a data-field path; a method is reached through IDENTITY(T).methods

Constitution I.K.iii

E2142type:unsafe-primitive-unknown

UNSAFE names no known unsafe primitive type

Fix
// UNSAFE.HANDLE h = EMPTY      // HANDLE, MUTEX, CONDVAR, ...

Constitution I.E

E2143foreign:c-type-outside-bind

C-ABI type is FOREIGN-declaration only

Fix
METHOD helper(uint64 n) RETURNS STATUS

Constitution I.D

E2144octet:not-a-counter

only an integer can be a counter or an index

Fix
FOR b IN bytes { }             // or LOOP b IN bytes WITH INDEX i
    int32 v = xs[0]            // say which position you mean
    int32 w = xs[r AS int32]   // say how the float becomes a position

Constitution I.D.i

E2145octet:number-is-not-an-octet

a number is not an octet — convert with AS or INTO

Fix
binary b = n INTO binary       // uint8/int8/char8 are total; wider integers take AS

Constitution I.D.i

E2146template:argument-constraint-too-weak

a forwarded type parameter is constrained less tightly than its slot requires

Fix
TEMPLATE: GIVEN TYPE T IS (Cloneable AND Comparable[T]):    // match what the slot requires

Constitution I.K

E2147octet:literal-does-not-fit

this literal fits no octet (0x00 through 0xFF)

Fix
binary b = 0xFF                // or widen the slot: uint16 w = 0x1FF

Constitution I.D.i

E2148type:sbo-starting-size-range

a T[N+] starting size must be between 4 and 65536

Fix
char32[128+] s   // or CREATE(n) when the size is genuinely large

Constitution I.J

E2149value:not-a-truth-value

a condition must be a boolean

Fix
IF count != 0 THEN { }         // say what you are testing

Constitution I.D.i

E2150char:not-a-number

a code point is not a number

Fix
char32 n = c + 1               // offset: still a code point
    int32 d = c - 'a'              // distance: how far apart, in code points

Constitution I.D.i

E2151char:does-not-fit

this code point leaves the declared char width

Fix
char16 a = 'x' + 200              // or widen the slot
    char b = '\U0010FFFF' - 1        // or stay inside the range

Constitution I.D.i

E2152boolean:not-a-number

a boolean is not a number

Fix
IF ok THEN { n = n + 1 }       // count what you meant to count
    boolean r = (a + b) != 0       // say what you are testing

Constitution I.D.i

E2153arith:hash-operand-not-wordkey

`#` takes an integer, a char or `binary` operand

Fix
uint64 h = #k                          // k an integer, char or binary: k mod 2^64

Constitution I.F

E2154foreign:unbounded-array-param

C cannot know where this array ends

Fix, one of
  1. Add an integer parameter named for its length — `C.size_t length`
  2. Bind a `String` instead, for a C string the call only reads

Constitution I.N

E2155type:expansive-template

Template names itself with a constructed argument

Fix
CLASS Grow[T] {
    Grow[T] next
}

Constitution I.K

E2156type:unresolved-after-substitution

Name does not resolve for this instantiation

Fix
// Narrow the use with WHEN T IMPLEMENTS …, or tighten the qualifier so every T has it

Constitution I.K

E2157module:internal-type-from-other-module

Another module's INTERNAL type is not visible here

Fix
// Use Lib's public surface, or make Frame public in Lib

Constitution I.N

E2158template:foreign-type-atom-outside-kernel

FOREIGN_TYPE qualifier atom is kernel-only

Fix
opaque db   // store the typed handle in an opaque; wrap it inside UNSAFE

Constitution I.K

E2159foreign:load-count-ambiguous

count fills two LOAD arrays

Fix, one of
  1. Bind one LOAD array per call, so `count` names the one C fills
  2. Rename the return, and the arrays keep the length of their bounds

Constitution I.N

E2160foreign:load-count-not-integer

count of a LOAD array is not an integer

Fix, one of
  1. Return the count as an integer type (`int32`, `C.ssize_t`)
  2. Rename the return if it is not the number of elements C wrote

Constitution I.N

E2161foreign:not-in-c-catalog

the bound name is not in the module's C catalog

Fix, one of
  1. If the name is right, delete build/c-catalog.json and rebuild: the catalog predates this binding
  2. If it is a typo, use the name the detail suggests

Constitution I.N

E2162foreign:c-arity

the binding's parameters do not match the C function's

Fix, one of
  1. Bind every parameter the C declaration has, in its order
  2. Remove RETURNS when the C function returns void

Constitution I.N

E2163foreign:c-scalar

a value's width or sign differs from the C declaration

Fix, one of
  1. Bind the type the C declaration names: a fixed-width primitive, or C.size_t, C.ssize_t, C.long, C.unsignedLong or C.mode_t

Constitution I.N

E2164foreign:c-pointer

a pointer's type differs from the C declaration

Fix, one of
  1. Bind an array of exactly the element type C points at
  2. Bind a FOREIGN_TYPE whose C spelling names that type

Constitution I.N

E2165foreign:c-wide-void

an array wider than bytes crosses as void *

Fix, one of
  1. Bind a byte array (binary, int8, uint8, char8) where C takes void *
  2. Convert the values to bytes with ByteOrderCodec.toBytes and pass the bytes

Constitution I.N

E2166foreign:c-variadic-promoted

a variadic argument C would promote

Fix, one of
  1. Bind a variadic argument as int32, int64 or float64: C widens anything narrower

Constitution I.N

E2167foreign:c-constant

a bound C constant is missing or does not fit

Fix, one of
  1. Declare a type the constant's value fits
  2. If the name is right, delete build/c-catalog.json and rebuild

Constitution I.N

E2168type:eq-on-array

`==`/`!=` on an array is not defined — compare contents with ->equals()

Fix
IF a->equals(b) THEN { ... }
IF NOT a->equals(b) THEN { ... }

Constitution I.J

E2169null-safety:empty-to-reference

EMPTY given where a REFERENCE is required

Fix
Widget w := CREATE Widget()
int32 r = look(w)                // pass a value that is present

Constitution I.I.iv

E2170type:op-param-not-reference

a handle class's operator method must take its operand as REFERENCE

Fix
CLASS Version {
    OPERATOR <(REFERENCE Version other) RETURNS boolean { ... }
}

Constitution I.F

E2171type:fixed-array-type-arg

a fixed-size array cannot be a template type argument

Fix
int32[] items := fixed INTO int32[]
Cell[int32[]] c := CREATE Cell[int32[]](items)

Constitution I.K

E2172type:fixed-array-growth

a fixed-size array cannot grow or shrink

Fix
int32[] cells := CREATE(4)
cells->reserve(10)   // a growable array, sized 4

Constitution I.J

E2173type:backing-class-named

a primitive's backing class cannot be named

Fix
complex w := z

Constitution I.D

E2174foreign:element-fact-outside-kernel

`ELEMENT OF T` is a kernel-only FOREIGN BIND parameter

Fix
// a module uses T[] and its methods; `LAYOUT OF T` (size and alignment) is legal anywhere

Constitution I.N

E2175type:return-narrowing

a RETURN may widen its value, never narrow it

Fix
Retriever r := d      // narrow at := (checked), then
RETURN (r)

Constitution I.K

E2176type:unrelated-lens-move

a move between two unrelated lenses; recover the concrete type first

Fix
Retriever r := b      // checked narrowing to the concrete class
Fetcher f := r        // then free widening

Constitution I.K

E2177type:type-hash-collision

two classes share one type hash; rename one

Fix
CLASS QzA9f3cRenamed ...              // any other name: the hashes differ

Constitution I.K

E3000–E3999

44 codes · mostly memory, foreign, reference

E3003memory:ref-outlives-owner

'&' reference may outlive its owner

Fix, one of
  1. Return by value
  2. Use `Box[T]` for heap-allocated sharing

Constitution I.I

E3005memory:cleanup-missing

Resource type requires CLEANUP block

Fix
CLASS File { METHOD open() { handle = openFile() } CLEANUP { closeFile(handle) } }

Constitution I.I

E3006memory:box-uninitialized

Box[T] field used before assignment

Fix
CLASS Tree { Box[Node] root
  METHOD init() { root = CREATE Node() } }

Constitution I.J

E3007memory:thread-capture-ref

Thread lambda cannot capture variables by reference

Fix
// Pass via CHANNEL instead of capturing

Constitution I.L

E3008memory:thread-capture-volatile

Thread lambda cannot capture enclosing VOLATILE fields

Fix
// Use CHANNEL to communicate state changes

Constitution I.L

E3009memory:current-thread-stored

currentThread cannot be assigned, stored, or passed

Fix
// Use currentThread->sleep() and currentThread->isCancelled() directly

Constitution I.L

E3010memory:moved-var

Variable accessed after being consumed

Fix
print(item.name)
nodes->append(item)

Constitution I.I

E3011memory:field-shadow

local variable shadows a class field

Fix, one of
  1. Assign the field — `SELF.<field> = ...`
  2. Keep a new local — rename it to clear the shadow

Constitution I.E

E3012memory:redeclaration

Name already declared in this or an enclosing scope

Fix, one of
  1. Reassign without a type — `x = ...`
  2. Rename — you need two distinct variables

Constitution I.E

E3013memory:iterator-scope

iterator accessed outside its creating block

Fix
{ Iterator it := items->iterator()
  it->next() }

Constitution I.J

E3015memory:group-recursion

GROUP member type contains a GROUP-typed field

Fix
CLASS Branch { Box[Tree] child }

Constitution I.J

E3016memory:thread-lambda-ref

Thread lambda cannot capture a local variable by reference

Fix
// Send msg through a CHANNEL before starting the thread

Constitution I.L

E3017memory:thread-expression-lambda

Thread argument must be a block-form lambda

Fix
Thread t = Thread(LAMBDA() { int32 result = compute()
  RETURN (result) })

Constitution I.L

E3018memory:thread-instance-method

Thread lambda cannot capture instance methods

Fix
// Extract data before thread, pass via CHANNEL

Constitution I.L

E3020memory:moved-in-return

Variable returned after being consumed

Fix
RETURN item
nodes->append(item)  // append after return is unreachable — rethink design

Constitution I.I

E3021memory:temporary-borrow-retained

temporary cannot be stored as a REFERENCE

Fix
Node n := CREATE Node(42)
Ref safe := CREATE Ref(n)   // `n` outlives `safe`

Constitution I.I

E3022memory:cleanup-return

RETURN inside CLEANUP skips remaining steps

Fix
CLEANUP { closeResource() }

Constitution I.I

E3023memory:multi-owner

Value assigned to two variables

Fix
MyClass a = CREATE MyClass()
MyClass b := a  // explicit deep copy

Constitution I.I

E3024memory:possibly-moved

variable possibly moved before this read

Fix
IF cond { other := x } ELSE { other := x.clone() }
use(other)

Constitution I.I

E3025memory:move-from-reference-field

Cannot use `:=` with a REFERENCE-field source

Fix
MyClass other := .refField.clone()  // deep-copy the referent

Constitution I.I

E3026memory:moved-out-field-used

an always-present field is used while it is moved out

Fix
Widget x := .w
.w := CREATE Widget()  // write it back before any read

Constitution I.I

E3027memory:auto-clone-reference-field

AUTO clone() cannot deep-copy a class with REFERENCE fields

Fix
CLASS Node IMPLEMENTS Cloneable { REFERENCE Node next
  METHOD clone() RETURNS Node { /* rewire next */ } }

Constitution I.I

E3028memory:auto-clone-foreign-type-field

AUTO clone() cannot copy a FOREIGN_TYPE field

Fix
CLASS Wrap IMPLEMENTS Cloneable { FOREIGN_TYPE (some_cpp_t) handle
  METHOD clone() RETURNS Wrap { /* copy explicitly */ } }

Constitution I.I

E3029memory:multi-return-reference-homogeneity

RETURNS-clause class positions must agree on REFERENCE-ness

Fix
METHOD pick() RETURNS (REFERENCE Foo a | REFERENCE Foo b) { }

Constitution I.I

E3030memory:multi-assign-op-mismatch-owning

a multi-assign with `=@` requires a REFERENCE-returning method

Fix
Foo a, Bar b := owningCall()

Constitution I.I

E3031memory:multi-assign-op-mismatch-reference

a multi-assign binding a REFERENCE-returning method must use `=@`

Fix
Foo a, Bar b =@ refCall()

Constitution I.I

E3032memory:strong-ref-reducible-to-borrow

SHARED MUTABLE REFERENCE field binds a SELF-reachable referent

Fix
Mon m                            // own it directly; no separate reference needed

Constitution I.I

E3033memory:strong-ref-cycle

Strong (refcounted) reference closes an ownership cycle

Fix
CLASS A { SHARED MUTABLE REFERENCE B b }
CLASS B { MUTABLE REFERENCE A a }          // one edge borrows

Constitution I.I

E3034memory:escaping-ref-into-value-storage

an escaping reference cannot be stored in value storage

Fix
Own the values — `Foo[] items`

Constitution I.I

E3036memory:unsafe-access-outside-unsafe-block

FOREIGN_TYPE field accessed outside an UNSAFE block

Fix
UNSAFE { int32 fam = res.ai_family }

Constitution I.N

E3037memory:unsafe-handle-escapes-confinement

FOREIGN_TYPE handle may not be stored

Fix
CLASS S { opaque cached }     // store opaque; rehydrate inside UNSAFE

Constitution I.N

E3038memory:borrow-into-owning-param

borrow cannot satisfy an owning parameter

Fix
items->append(arr[i]->clone())  // hand over an owned copy

Constitution I.I

E3039reference:mode-flip-unsupported

reference mode-flip not supported in V1

Fix
REFERENCE Widget h =@ .anchor
Widget owned := CREATE Widget()   // use a fresh local

Constitution I.I

E3040memory:escaping-local-reference

a reference outlives the source it borrows

Fix
Keep the holder inside the scope of its source, move the value into the holder instead of borrowing it, or hand over a copy with DUPLICATE

Constitution I.I

E3041foreign:inline-block-removed

inline FOREIGN { } block is not permitted

Fix
FOREIGN BIND some_c_call(...) RETURNS ...      // reach native code through a bound shim

Constitution I.N

E3042foreign:requires-allows-foreign

FOREIGN BIND requires "allows-foreign": true in the module manifest

Fix
set "allows-foreign": true in <module>.json     // opt in to the foreign boundary

Constitution I.N

E3043memory:move-from-subscript

a subscript is not a removal

Fix
IF arr->remove(0) THEN { sink->append($=) }   // remove() moves it out

Constitution I.I

E3044memory:escaping-view

a view outlives the local it borrows

Fix
RETURN (CREATE String(v->copy()))   // materialise the slice into owned storage

Constitution I.J

E3045memory:reference-unresolvable

a reference is handed to a callee whose body cannot be read

Fix, one of
  1. Create the receiver in this method, so the walk reads its class
  2. Rebuild the dependency so its .evir is current
  3. Pass a copy (DUPLICATE) rather than a holder of a borrow

Constitution I.A

E3046memory:reference-walk-incomplete

the walk could not finish following this reference to its owner

Fix, one of
  1. Bind the referent to a named local and reference that
  2. Report it — a walk that cannot finish is a compiler limit, not a defect in this program

Constitution I.A

E3047memory:view-after-source-move

a view is read after its source was moved away

Fix
// read the view BEFORE the move, or give the sink a copy and keep src

Constitution I.J

E3048memory:shared-ref-outlives-referent

a SHARED MUTABLE REFERENCE may outlive what it points at

Fix
Declare the owner before the holder, keep the holder inside the owner's scope, or give the holder its own copy with DUPLICATE

Constitution I.I

E3049memory:shared-layout-overaligned

SHARED CLASS field needs 16-byte alignment

Fix
Hold the value behind a class-typed field, or keep it out of the monitor: a shared object may need at most 8-byte alignment

Constitution I.K

E3050memory:opaque-foreign-outside-unsafe

opaque[H] over a C handle outside UNSAFE

Fix
UNSAFE { opaque box := opaque[SQLITE3]->wrap(h) }

Constitution I.D

E4000–E4999

47 codes · mostly control, concurrency, type

E4001control:unreachable

unreachable code after a RETURN/PANIC/UNREACHABLE!/BREAK/CONTINUE

Fix
print("done")
RETURN 0

Constitution I.H

E4004control:break-outside-loop

BREAK used outside of a loop

Fix
METHOD run() { FOR i = 0 TO 10 { IF done { BREAK } } }

Constitution I.H

E4005control:continue-outside-loop

CONTINUE used outside of a loop

Fix
METHOD run() { FOR i = 0 TO 10 { IF skip { CONTINUE } } }

Constitution I.H

E4006control:finally-after-return

FINALLY must be declared before any RETURN or PANIC

Fix
METHOD run() { FINALLY { cleanup() }
  RETURN 0 }

Constitution I.M

E4009control:throw-in-finally

PANIC is not allowed in FINALLY

Fix
FINALLY { cleanup() }

Constitution I.M

E4010control:status-else

ELSE is invalid after STATUS IS

Fix
MATCH s { WHEN SUCCESS: { } WHEN FAILURE: { } }

Constitution I.M

E4011control:nested-loop-anon

Nested anonymous LOOP blocks are ambiguous

Fix
LOOP $_ { LOOP $item { } }

Constitution I.H

E4012control:match-void

MATCH target expression cannot be void

Fix
MATCH getStatus() { }

Constitution I.H

E4013control:when-unreachable

Duplicate WHEN pattern

Fix
MATCH d { WHEN NORTH: { } WHEN SOUTH: { } }

Constitution I.H

E4014control:for-bounds

a FOR loop counts, so its bounds must be whole numbers

Fix
FOR i = 0 TO 26 { }
    FOR i = 0 UNTIL (rate AS int32) { }   // say how the float becomes a count

Constitution I.H

E4016control:catch-too-broad

RECOVER block catches base Error

Fix
RECOVER (IOException e) { }

Constitution I.M

E4017control:try-no-catch

TRY has no RECOVER and no FINALLY

Fix
TRY { risky() } RECOVER (IOException e) { handle(e) }

Constitution I.M

E4018control:status-without-check

STATUS value assigned but never checked

Fix
STATUS s = operation()
IF s IS FAILURE { handleError(s) }

Constitution I.M

E4019control:when-guard-always-false

WHEN guard is always false (unreachable)

Fix
// Remove the unreachable WHEN clause

Constitution I.H

E4020control:match-on-non-value

MATCH target must produce a value

Fix
STATUS s = doWork()
MATCH s { }

Constitution I.H

E4022control:throw-non-error

PANIC argument must extend Error

Fix
PANIC MyError("something went wrong")

Constitution I.M

E4023control:label-not-enclosing

that label does not enclose this jump

Fix, one of
  1. Use a boolean flag to exit
  2. Extract the inner loop to a METHOD that returns early

Constitution I.H

E4024control:loop-dot-field

dot-prefix iterator fields need LOOP $_

Fix
LOOP $_ IN items { int32 n = .index }

Constitution I.H

E4025control:for-step-direction

FOR STEP sign must match the direction

Fix
FOR i = 10 TO 0 STEP -1 { }

Constitution I.H

E4026control:super-non-subclass

SUPER needs a class that EXTENDS

Fix
// Remove SUPER() or add EXTENDS Parent to the class declaration

Constitution I.K

E4027control:catch-non-error

RECOVER type is not an Error subclass

Fix
RECOVER (IOError e) { }  // catch a class that EXTENDS Error

Constitution I.M

E4028type:recursive-value-type

value type contains itself, giving infinite size

Fix
CLASS Node { Node child }  // a class field is a handle

Constitution I.D

E4029control:super-field-access

SUPER.field is not valid — reach a parent field with `.field`

Fix
RETURN (.length)        // Envzn forbids field shadowing, so there is one field of each name; SUPER is only for SUPER(args) and SUPER->method()

Constitution I.K

E4030control:match-not-closed-set

MATCH pattern must name an enum case, GROUP member, or STATUS kind

Fix
IF n == 5 THEN { } ELSE IF (n >= 1) AND (n <= 9) THEN { } ELSE { }

Constitution I.H

E4031control:match-type-arm-needs-bind

a MATCH arm naming a TYPE must bind it

Fix
MATCH shape { WHEN Circle c: { } }

Constitution I.H

E4032control:loop-index-readonly

the LOOP index is read-only

Fix
LOOP row IN orders WITH INDEX i { }   // i is the loop's own state

Constitution I.H

E4033control:loop-comma-pair

LOOP does not take a comma pair

Fix
LOOP row IN orders WITH INDEX i { }

Constitution I.H

E4034control:with-index-on-non-loop

WITH INDEX belongs to LOOP only

Fix
LOOP row IN orders WITH INDEX i { }

Constitution I.H

E4035control:continue-names-non-loop

CONTINUE needs a label that names a loop

Fix
LABEL attempt { BREAK attempt }       // a block has no next iteration

Constitution I.H

E4036control:label-crosses-boundary

a labelled jump cannot cross this boundary

Fix
LABEL outer FOR a IN xs { PARALLEL { } }   // signal the outer loop instead

Constitution I.H

E4037control:label-jump-in-finally

a labelled jump cannot appear in a FINALLY

Fix
FINALLY { }                            // as with RETURN and PANIC

Constitution I.H

E4038control:label-name-collides

that label name is already used in this class

Fix
LABEL rows FOR x IN xs { }   // one name, one place, per class

Constitution I.H

E4039control:label-malformed

LABEL takes a name then a loop or block

Fix
LABEL rows FOR x IN xs { }

Constitution I.H

E4090concurrency:thread-class-retired

Thread is retired — use CONCURRENT

Fix
CONCURRENT {
    // myBody code here — runs as a Task; the block
    // joins before exiting.
}

Constitution I.L

E4091concurrency:switchboard-retired

ThreadSwitchboard is retired — use MessageBroker[T]

Fix
MessageBroker[OrderEvent] orders := CREATE MessageBroker[OrderEvent]()
CONCURRENT {
    Subscription[OrderEvent] sub := orders->subscribe(64, BackpressurePolicy.BLOCK)
    FOR ev IN sub { … }
}

Constitution I.L

E4092concurrency:thread-inbox-retired

ThreadInbox is retired — use Channel[T] or MessageBroker[T]

Fix
Channel[String] box := CREATE Channel[String](32, BackpressurePolicy.BLOCK)

Constitution I.L

E4093concurrency:send-message-retired

->send_message is retired — use Channel.send or MessageBroker.publish

Fix
// For point-to-point: channel->send(payload)
// For broadcast:        broker->publish(payload)

Constitution I.L

E4094concurrency:currentthread-retired

currentThread is retired — use currentTask

Fix
currentTask->sleep(100)

Constitution I.L

E4095concurrency:delivery-mode-retired

DeliveryMode is retired — type-keyed dispatch replaces it

Fix
channel->send(payload)   // Channel is point-to-point by type

Constitution I.L

E4100concurrency:scope-capture-non-owning

CONCURRENT body cannot borrow an outer variable

Fix
Channel[int32] inbox := CREATE Channel[int32](1, BackpressurePolicy.BLOCK)
CONCURRENT {
    inbox->send(1)
}
IF inbox->receive() THEN { int32 counter = $= }

Constitution I.L

E4101concurrency:scope-implicit-self

CONCURRENT body cannot call an instance method

Fix, one of
  1. Move the state into the block
  2. Send it through a `Channel`

Constitution I.L

E4102concurrency:scope-volatile-read

CONCURRENT body cannot read enclosing VOLATILE fields

Fix
// Publish via MessageBroker[StatusEvent] or read through a scoped Channel.

Constitution I.L

E4103concurrency:task-not-user-constructible

`Task` cannot be constructed directly

Fix
CONCURRENT {
    print(currentTask->name())
}

Constitution I.L

E4104concurrency:future-not-user-constructible

`Future[T]` cannot be constructed directly

Fix
Future[int32] f := pool->submit(job, fn)
int32 result := f->await()

Constitution I.L

E4105concurrency:parallel-outside-concurrent

PARALLEL is legal only inside CONCURRENT

Fix
CONCURRENT {
    PARALLEL { fetchData() }
}

Constitution I.L

E4109concurrency:v2-detached

DETACHED CONCURRENT is reserved for V2

Fix
// Use CONCURRENT { ... } and let the scope guard manage lifetime

Constitution I.L

E4110concurrency:mutex-data-outside-synchronized

Mutex[T].data is reachable only inside a SYNCHRONIZED block

Fix
SYNCHRONIZED counter {
    int32 v := counter.data
}

Constitution I.L

E5000–E5999

16 codes · mostly collections, absence, reference

E5003collections:mutation-lock

source is locked by a live borrow

Fix
{ StringView w := b->view(0, 5)  use(w) }   STATUS s = b->append("x")

Constitution I.J

E5005collections:mixed-types

Array literal contains mixed types

Fix
int32[] arr = [1, 2, 3]

Constitution I.J

E5006absence:empty-non-object

EMPTY applies only to an object handle

Fix
int32 count = 0
String name = ""

Constitution I.D

E5008collections:set-equatable

Set element type must implement Equatable

Fix
{String} items = EMPTY  // String is Equatable

Constitution I.J

E5009collections:for-in-non-iterable

FOR IN target is not iterable

Fix
FOR x IN myArray { }

Constitution I.H

E5013collections:for-in-non-array

FOR IN target is not an array

Fix
FOR x IN myArray { }

Constitution I.H

E5015collections:append-wrong-type

->append() argument type differs from the element

Fix
int32[] nums = EMPTY
nums->append(5)

Constitution I.J

E5016collections:dict-remove-status

Dictionary->remove() returns (K, STATUS)

Fix
STATUS s
String k, s := myDict->remove("key")
IF s IS SUCCESS { /* key was present */ }

Constitution I.J

E5017collections:set-add-type

->add() argument type differs from Set element

Fix
{int32} ids = EMPTY
ids->add(42)

Constitution I.J

E5018collections:negative-index

array index is negative

Fix
int32 x = arr[arr.size() - 1]

Constitution I.J

E5021collections:sortedlist-comparable

SortedList element type must implement Comparable

Fix, one of
  1. Make the element type `IMPLEMENTS Comparable`
  2. Use `SortedList OF String`

Constitution I.J

E5022collections:for-in-string

FOR IN does not support String

Fix
FOR c IN myString->toCharArray() { }

Constitution I.H

E5023collections:dict-lookup-type

Dictionary->lookup() needs two LHS variables

Fix
STATUS s
int32 val, s := map->lookup("key")

Constitution I.J

E5024reference:read-before-rebind

REFERENCE local read before being `=@`-rebound

Fix
REFERENCE int32 x
int32 source = 42
x =@ source
int32 y = x       // OK

Constitution I.K

E5025collection:object-slot-requires-move-assign

object-array move must use `:=`, not `=`

Fix
objs[i] := src   // := relocates (moves) — the one outward difference between object[] and int32[]

Constitution I.J

E5026collections:array-equals-equatable

Array element type must implement Equatable to compare with equals()

Fix
{String} a = EMPTY  a->equals(b)   // String is Equatable

Constitution I.J

E6000–E6999

104 codes · mostly oop, reference, type

E6001oop:empty-interface

INTERFACE declares no methods

Fix, one of
  1. Add method declarations to the INTERFACE
  2. Change to GROUP — a classifier with no methods

Constitution I.K

E6002oop:empty-group

GROUP declares no member types

Fix
GROUP Shape { Circle, Square }

Constitution I.K

E6003oop:struct-object-field

STRUCT fields must be primitives or String

Fix
STRUCT Point { int32 x
  int32 y }

Constitution I.K

E6004oop:struct-method

STRUCT may not have methods

Fix
CLASS Point { int32 x
  METHOD move() { } }

Constitution I.K

E6005oop:struct-extends

STRUCT may not use EXTENDS or IMPLEMENTS

Fix
CLASS Point EXTENDS Shape { }

Constitution I.K

E6006oop:abstract-not-implemented

Abstract method not implemented in subclass

Fix
CLASS Dog EXTENDS Animal { METHOD speak() { print("woof") } }

Constitution I.K

E6007oop:final-class

Cannot extend a FINAL CLASS

Fix, one of
  1. Remove `FINAL` from the parent
  2. Do not extend it

Constitution I.K

E6008oop:final-method

Cannot override a FINAL METHOD

Fix, one of
  1. Remove `FINAL` from the parent method
  2. Do not override it

Constitution I.K

E6009oop:private-field

Class field is private

Fix, one of
  1. Add an accessor method to the class
  2. Declare the field `SHARED`

Constitution I.K

E6010oop:shared-field-mutation

SHARED field mutable only within its hierarchy

Fix
// Use SHARED VOLATILE to allow mutation from subclasses

Constitution I.K

E6011oop:missing-super-init

subclass INIT must call SUPER() first

Fix
CLASS Child EXTENDS Parent { METHOD init() { SUPER()
  setup() } }

Constitution I.K

E6012oop:super-not-first

SUPER() must be the first INIT statement

Fix
CLASS Child EXTENDS Parent { METHOD init() { SUPER()
  int32 x = 5 } }

Constitution I.K

E6015oop:group-member-recursion

GROUP member field has the GROUP's type

Fix
CLASS Branch { Box[Tree] subtree }

Constitution I.J

E6016oop:struct-no-fields

STRUCT must declare at least one field

Fix
STRUCT Point { int32 x
  int32 y }

Constitution I.K

E6018oop:multiple-extends

CLASS may EXTENDS at most one parent

Fix
CLASS C EXTENDS A IMPLEMENTS B { }  // or use interfaces

Constitution I.K

E6019oop:enum-extends

ENUM may use neither EXTENDS nor IMPLEMENTS

Fix
ENUM Color { RED GREEN }   // an enum is a list of cases, nothing more

Constitution I.K

E6020oop:interface-not-implemented

class does not implement all interface methods

Fix
CLASS Dog IMPLEMENTS Runnable { METHOD run() { } }

Constitution I.K

E6021oop:interface-method-body

Interface method may not have a body

Fix
INTERFACE I { METHOD run() }

Constitution I.K

E6022oop:override-on-abstract

OVERRIDE not needed for an abstract method

Fix
METHOD speak() { }  // no OVERRIDE needed for abstract implementations

Constitution I.K

E6023oop:interface-conflict

Interface inheritance conflict

Fix
// Resolve conflict by declaring a merged run() signature in C

Constitution I.K

E6024oop:enum-non-exhaustive-method

enum method must MATCH all cases

Fix, one of
  1. Add a `WHEN` for the missing variant
  2. Add a `DEFAULT` branch

Constitution I.K

E6025oop:field-group-type

a recursive GROUP-typed class field must use Box[T]

Fix
CLASS Node { Box[Tree] parent }

Constitution I.J

E6026oop:duplicate-field-name

field name conflicts with an inherited field

Fix, one of
  1. Rename the field in the child
  2. Use the inherited field directly

Constitution I.K

E6027oop:anonymous-class

Anonymous class declaration is not permitted

Fix
CLASS CustomShape EXTENDS Shape { METHOD draw() { } }
CustomShape s := CREATE CustomShape()

Constitution I.K

E6028oop:inner-type

type declarations may not nest in CLASS

Fix
// Move Inner to its own file: Inner.ev

Constitution I.N

E6029oop:abstract-instantiate

cannot instantiate an ABSTRACT CLASS

Fix
// Instantiate a concrete subclass: Circle s := CREATE Circle()

Constitution I.K

E6030oop:struct-visibility

STRUCT fields may not have visibility modifiers

Fix
STRUCT Point { int32 x }

Constitution I.K

E6031oop:struct-init

STRUCT may not declare an INIT method

Fix
STRUCT Point { int32 x
  int32 y }  // INIT auto-generated

Constitution I.K

E6032oop:class-volatile-non-volatile

VOLATILE mutation requires a VOLATILE field

Fix
VOLATILE int32 count = 0  // declare VOLATILE to allow mutation by subclasses

Constitution I.K

E6033oop:super-twice

SUPER() may be called only once

Fix
CLASS Child EXTENDS Parent { METHOD init() { SUPER()
  x = 5 } }

Constitution I.K

E6034oop:module-private-access

Type is not exported from its module

Fix
// Add EXPORT to the type declaration in its module: EXPORT CLASS InternalHelper

Constitution I.N

E6035oop:interface-extends-non-interface

INTERFACE may only EXTENDS another INTERFACE

Fix
INTERFACE Swimmer EXTENDS Moveable { }  // Moveable is an INTERFACE

Constitution I.K

E6036oop:group-non-member-match

WHEN names a non-member of the GROUP

Fix
MATCH pet { WHEN Dog d: { } WHEN Cat c: { } }

Constitution I.K

E6038syntax:rebind-on-owned-lhs

=@ requires a REFERENCE or MUTABLE REFERENCE LHS

Fix
REFERENCE int32 x =@ scores[0]    // observe
// or
int32 x := scores[0]              // move (poisons source)

Constitution I.G

E6039oop:nested-type-not-private

nested ENUM/STRUCT in CLASS must be PRIVATE

Fix
CLASS UTFCodec { PRIVATE ENUM State { BEGIN, ERROR } }

Constitution I.K

E6040type:move-from-reference

:= cannot move ownership out of a REFERENCE

Fix
Widget owned := DUPLICATE r        // explicit copy
Widget e := DUPLICATE arr[i]    // or =@ to borrow, remove(i) to take, swap(i, j) to move within

Constitution I.G

E6041type:is-valid-on-reference

IS VALID does not apply to a REFERENCE

Fix
// drop the check — h is always valid here
.use(h)

Constitution I.D

E6042type:is-valid-on-primitive

IS VALID does not apply to a primitive value

Fix
// drop the check — primitives are always defined

Constitution I.D

E6043type:is-valid-on-status

IS VALID does not apply to STATUS

Fix
STATUS s = service->call()
IF s IS SUCCESS THEN { ... }

Constitution I.D

E6044type:is-valid-on-enum

IS VALID does not apply to enums

Fix
MATCH c {
    WHEN Color.RED:   ...
    WHEN Color.BLUE:  ...
    WHEN Color.GREEN: ...
}

Constitution I.D

E6045type:is-valid-on-struct

IS VALID does not apply to STRUCTs

Fix
// drop the check — STRUCT values are always defined

Constitution I.D

E6046reference:outlives-referent

a reference cannot outlive its referent

Fix
Narrow the reference to the inner scope

Constitution I.I

E6047reference:shared-xor-mutable

REFERENCE and MUTABLE REFERENCE cannot coexist on one source

Fix
// Drop r before establishing the mutable reference:
MUTABLE REFERENCE Widget rw =@ .target
.modifyVia(rw)

Constitution I.I

E6048reference:mutation-through-other-path

cannot mutate a borrowed source

Fix
// Drop r first (narrow its scope), then mutate:
{
    REFERENCE Widget r =@ items[0]
    .use(r)
}
items->append(other)

Constitution I.I

E6049reference:elision-ambiguous

lifetime elision is ambiguous with multiple references

Fix
// Split into two methods, each with a single reference input:
METHOD mergeFrom(REFERENCE List other) RETURNS REFERENCE List   // SELF is implicit input

Constitution I.I

E6050pipe-return:status-must-be-final

STATUS must be the final RETURNS slot

Fix
METHOD foo() RETURNS (MyClass c | STATUS s)

Constitution I.M

E6051pipe-return:return-must-name-one-side

pipe RETURN must populate exactly one side, fully

Fix
METHOD foo() RETURNS (MyClass c, int32 n | STATUS s) {
    RETURN (c, n)            // full success tuple — or RETURN (s)
}

Constitution I.M

E6052pipe-return:return-names-unknown-slot

RETURN identifier must match a slot name

Fix
METHOD foo() RETURNS (MyClass c | STATUS s) {
    c := CREATE MyClass()
    RETURN (c)               // c is the declared slot
}

Constitution I.M

E6053pipe-result:scope

$= / $! valid only inside IF-pipe

Fix
IF foo() THEN {
    MyClass local := $=
}

Constitution I.M

E6054reference:reference-chain

=@ source may not be another REFERENCE

Fix
REFERENCE Widget a =@ .anchor
REFERENCE Widget b =@ .anchor   // both root at the place

Constitution I.I

E6055reference:call-arg-aliasing

one place passed to two MUTABLE REFERENCE parameters

Fix
swap(box, other) // distinct places

Constitution I.I

E6056oop:auto-clone-no-zero-arg-init

AUTO METHOD clone() requires a zero-arg INIT()

Fix
CLASS Foo IMPLEMENTS Cloneable { INIT() { } INIT(int32 n) { } AUTO METHOD clone() { } }

Constitution I.K

E6057oop:auto-clone-cascade-failure

AUTO clone() needs every owning field Cloneable

Fix
CLASS Bar IMPLEMENTS Cloneable { AUTO METHOD clone() { } }
CLASS Foo IMPLEMENTS Cloneable { Bar b
  AUTO METHOD clone() { } }

Constitution I.K

E6058oop:clone-receiver-not-cloneable

->clone() receiver's static type does not implement Cloneable

Fix
CLASS Foo IMPLEMENTS Cloneable { AUTO METHOD clone() { } }
Foo a := other->clone()

Constitution I.K

E6059oop:cxx-reserved-outside-kernel

`_cxx*` types are kernel-internal

Fix
Mutex m

Constitution II.L

E6060oop:cxx-reserved-inheritance

cannot EXTENDS / IMPLEMENTS a `_cxx*` type

Fix
CLASS MyLock { Mutex inner }

Constitution II.L

E6061pipe-result:reread

pipe success value consumed on first read

Fix
IF foo() THEN {
    Token got := $=
    // use `got` everywhere below; no second `$=` / `$RETURNED`
}

Constitution I.M

E6062oop:union-outside-kernel

`UNION` is a kernel-internal storage construct

Fix
// declare UNION only in the ENVZN kernel; consumers use the value-class that wraps it

Constitution II.L

E6063oop:foreign-type-deprecated

the FOREIGN_TYPE keyword is deprecated

Fix
// kernel: CLASS Wrap { _cxxsomething handle }
// module:  model as a proper Envzn class instead

Constitution II.L

E6064pipe-result:value-use

pipe-shaped result is not a value

Fix
IF Stdio->printline("hi") THEN {
    int32 written := $=
}

Constitution I.M

E6065oop:method-not-on-type

method not on the receiver's static type

Fix
ReferenceIterator OF T it := coll->iterator()
IF it->next() THEN { }   // next() resolves on ReferenceIterator

Constitution I.K

E6066oop:auto-clone-not-cloneable

AUTO clone() requires IMPLEMENTS Cloneable

Fix
CLASS Foo IMPLEMENTS Cloneable { AUTO METHOD clone() { } }

Constitution I.K

E6067reference:loosen-mutable

cannot bind MUTABLE REFERENCE from an immutable receiver

Fix
REFERENCE int32 r =@ constHolder->slot()

Constitution I.I

E6068type:is-valid-on-always-present

IS VALID does not apply to a String

Fix
IF s->isEmpty() THEN { ... }    // test the CONTENT, not presence

Constitution I.D

E6070oop:instantiate-non-instantiable

cannot CREATE a SINGLETON or NAMESPACE — it has no constructible instance

Fix
System->exit(0)   // call a SINGLETON method with ->  (a NAMESPACE: Math.sqrt(x) with .)

Constitution I.K

E6071reference:modify-through-readonly

a MODIFY method cannot be called through a read-only REFERENCE

Fix
MUTABLE REFERENCE Counter mc =@ c
mc->bump()   // or call on an owned/mutable receiver

Constitution I.I

E6073oop:abstract-no-abstract-method

an ABSTRACT CLASS must declare at least one ABSTRACT METHOD

Fix
ABSTRACT CLASS Base { ABSTRACT METHOD run() RETURNS int32 }   // or use a regular CLASS

Constitution I.K

E6074oop:abstract-method-in-concrete-class

an ABSTRACT METHOD may appear only inside an ABSTRACT CLASS

Fix
ABSTRACT CLASS Animal { ABSTRACT METHOD speak() RETURNS String }

Constitution I.K

E6075oop:abstract-generic

an ABSTRACT CLASS may not be a generic template

Fix
// abstract classes are non-generic in V1 — give it a concrete surface

Constitution I.K

E6076oop:field-not-on-type

no such data field on the receiver's static type

Fix
int32 n = ds->length()          // no phantom fields (I.C.c.i) — call the method

Constitution I.C

E6077oop:abstract-private

ABSTRACT cannot be combined with PRIVATE

Fix
ABSTRACT METHOD area() RETURNS int32            // an abstract member is a subclass contract, so it stays visible

Constitution I.K

E6078pipe-result:multi-assign

pipe-XOR result needs IF, not multi-assign

Fix
IF d->lookup(key) THEN {
    int32 v := $RETURNED
}
ELSE { /* handle the miss */ }

Constitution I.M

E6079oop:create-shortcut-needs-concrete

CREATE shortcut cannot infer a concrete type from an interface

Fix
// Shape s := CREATE Circle(5.0)   // name the implementation

Constitution I.J

E6080oop:group-member-unresolved

GROUP member names no known type

Fix
GROUP Shape { Circle, Square }

Constitution I.J

E6081oop:group-member-ineligible

GROUP member is not a classifiable type

Fix
GROUP Places { Path, File }

Constitution I.J

E6082oop:group-cycle

GROUP contains itself through its members

Fix
GROUP Alpha { Circle, Square }
GROUP Beta { Square, Alpha }

Constitution I.J

E6083oop:group-not-a-storage-type

GROUP classifies types but cannot hold a value

Fix
TEMPLATE: GIVEN TYPE T IS Collectable:
CLASS Holder OF T { }

Constitution I.J

E6084oop:assign-unknown-field

assignment names a field the class does not have

Fix
sv = source->view(0, n)   // build a valid view instead

Constitution I.K

E6085oop:assign-array-surface

an array has no assignable member

Fix
a[a.length] = value   // high-water-mark append; .length is read-only

Constitution I.J

E6086oop:unknown-struct-field

struct has no field by that name

Fix
int32 w = spec.align   // the declared field name

Constitution I.J

E6087reference:mutation-through-retained-borrow

cannot mutate a source a live object borrows

Fix
// Narrow the holder so its borrow ends first:
{
    Holder h := CREATE Holder(a)
    .use(h)
}
a->clear()

Constitution I.I

E6088oop:private-method

Class method is private

Fix
// Drop PRIVATE, or call it through a public method of Vault:
CLASS Vault {
    METHOD triple() RETURNS int64 { RETURN (.n * 3) }
}

Constitution I.K

E6089oop:supertype-not-a-class

a primitive cannot be a base type

Fix
CLASS MyClass EXTENDS Shape { }        // EXTENDS names a CLASS

Constitution I.K

E6090oop:interface-implements

an INTERFACE composes with EXTENDS — it implements nothing

Fix
INTERFACE Dictionary EXTENDS Cloneable, Equatable { ... }

Constitution I.K

E6091oop:interface-extends-conflict

two extended interfaces declare the same method incompatibly

Fix
Rename one method, or extend only the interface whose contract you mean

Constitution I.K

E6092oop:parametric-interface-bare

a parametric type must be named with its type arguments

Fix
TEMPLATE: GIVEN TYPE K IS (Cloneable AND Equatable[K]):

Constitution I.K

E6093oop:type-name-not-value

a class name is not a value — create an instance first

Fix
Widget w := CREATE Widget()
int32 n = w.size

Constitution I.K

E6094oop:modify-mode-mismatch

MODIFY must match the interface or parent method it implements

Fix
CLASS Main IMPLEMENTS TaskStarter { METHOD start() RETURNS STATUS { ... } }   // start() is non-mutating

Constitution I.K.vi

E6095oop:protected-field

a PROTECTED field is reachable only from its class and subclasses

Fix
// read it inside Base or a subclass of Base, or expose a public METHOD

Constitution I.K

E6096oop:protected-method

a PROTECTED method is callable only from its class and subclasses

Fix
// call it inside Base or a subclass of Base, or make it public

Constitution I.K

E6097oop:param-mode-mismatch

a parameter's mode must match the slot it implements

Fix
CLASS Point IMPLEMENTS Equatable OF Point {
    METHOD equals(REFERENCE Point other) RETURNS boolean { ... }
}

Constitution I.I.vi

E6098class:super-no-matching-init

SUPER arguments fit no parent INIT

Fix, one of
  1. Pass arguments that exactly one of the parent's own INITs accepts
  2. Add the INIT you meant to the parent class

Constitution I.K

E6099oop:implementation-narrows-access

an interface method's implementation must be public

Fix
CLASS Dog IMPLEMENTS Speaks {
    METHOD speak() RETURNS int64 { RETURN (1) }
}

Constitution I.K

E6100serde:class-without-restore

reconstructed CLASS declares no RESTORE

Fix
CLASS Person { MODIFY METHOD RESTORE() RETURNS STATUS { RETURN (SUCCESS) } }

Constitution I.P

E6101serde:field-not-serializable

field type cannot be serialized

Fix
Mark the field DERIVED, or give it a serializable type

Constitution I.P

E6102serde:interface-typed-field

interface-typed field is not serializable in V1

Fix
Hold the concrete type instead of the interface

Constitution I.P

E6103serde:dictionary-key-not-text

Dictionary key has no reversible text form

Fix
Dictionary[String, int32] scores

Constitution I.P

E6104serde:reference-field

REFERENCE field is not serializable in V1

Fix
Mark the field DERIVED and rebuild it in RESTORE

Constitution I.P

E6105oop:override-narrows-access

an override cannot narrow its parent method's access

Fix
CLASS Dog EXTENDS Animal {
    OVERRIDE METHOD sound() RETURNS int64 { RETURN (1) }
}

Constitution I.K

E6106serde:derived-misuse

DERIVED needs a RESTORE to compute it

Fix
Use a CLASS with a RESTORE, or drop DERIVED

Constitution I.P

E6107serde:collection-not-synthesized

only Array has a synthesized codec in V1

Fix
Use Array[T], or mark the field DERIVED

Constitution I.P

E6109pipe-result:unbound

`$=` is typeless: bind it before using it

Fix
IF hay->find(ndl) THEN {
    int64 at = $=
    process(at)
}

Constitution I.M

E6110oop:union-arm-kind

this UNION arm cannot be held by a union

Fix
UNION Store {
    int64 i
    Cloneable obj    // hold the array behind a class handle
}

Constitution I.D

E6111oop:union-owning-arm-overwrite

an owning UNION arm may already be live here

Fix
METHOD wrap(Cloneable o) RETURNS Box {
    Box p := CREATE Box()
    p.store.obj := o   // a value this body just built
    RETURN (p)
}

Constitution I.D

E7000–E7999

27 codes · mostly method

E7002method:variadic-not-last

variadic parameter must come last

Fix
METHOD run(int32 count, String... args) { }

Constitution I.K

E7003method:multiple-variadic

at most one variadic parameter per method

Fix
METHOD run(String... names) { }

Constitution I.K

E7004method:variadic-non-array

variadic parameter type must be an array

Fix
METHOD run(String... args) { }

Constitution I.K

E7005method:named-return-missing

named return not assigned on all paths

Fix
METHOD run() RETURNS (int32 result) { IF cond { result = 5 } ELSE { result = 0 } RETURN (result) }

Constitution I.K

E7007method:override-param-mismatch

override parameter types differ from the parent

Fix
OVERRIDE METHOD run(int32 x) { }

Constitution I.K

E7008method:override-return-mismatch

override return type differs from the parent

Fix
OVERRIDE METHOD getValue() RETURNS (int32 n) { }

Constitution I.K

E7009method:ref-in-signature

'&' is not valid in method signatures

Fix
METHOD keep(Array[int32] xs) { }  // the declared type says how it is passed — plain (own) / REFERENCE / MUTABLE REFERENCE

Constitution I.I.vi

E7010method:interface-incompatible

method signature incompatible with the implemented interface

Fix
CLASS Dog IMPLEMENTS Animal { METHOD speak() { } }

Constitution I.K

E7011method:param-shadows-field

Method parameter name shadows a class field

Fix
CLASS C { int32 count
  METHOD add(int32 amount) { count += amount } }

Constitution I.E

E7012method:param-shadows-return

parameter name duplicates a named return

Fix
METHOD run(int32 input) RETURNS (int32 result) { }

Constitution I.E

E7015method:local-shadows-param

Local variable name shadows a method parameter

Fix
METHOD run(int32 count) { int32 localCount = 0 }

Constitution I.E

E7016method:consumed-after-append

Variable passed to ->append() is consumed

Fix
print(obj.name)
items->append(obj)

Constitution I.I

E7017method:deprecated

This method is deprecated — see suggestion for replacement

Fix
// See DEPRECATED message on the method for guidance

Constitution I.K

E7018method:arg-count-mismatch

Method call has wrong number of arguments

Fix
result = obj->compute(1, 2)

Constitution I.K

E7021method:return-value-discarded

Return value discarded without '$?'

Fix
int32 code, String msg := obj->parse(data)
// or discard it: $? := obj->parse(data)

Constitution I.M

E7022method:lambda-multi-return

lambda block needs exactly one RETURN

Fix
items->map(LAMBDA(x) { int32 result = IF x > 0 { x } ELSE { -x }
  RETURN (result) })

Constitution I.F

E7023method:lambda-no-return

lambda block needs a RETURN statement

Fix
items->map(LAMBDA(x) { int32 y = x * 2
  RETURN (y) })

Constitution I.F

E7024method:overload-ambiguous

ambiguous method call — multiple overloads match

Fix, one of
  1. Rename one overload
  2. Add a more specific type at the call site

Constitution I.K

E7025method:named-return-format

named returns use RETURN (varName) syntax

Fix
METHOD run() RETURNS (int32 code) { code = 0
  RETURN (code) }

Constitution I.K

E7026method:lambda-thread-self

Thread lambda cannot reference SELF

Fix
// Extract data before thread, send via CHANNEL

Constitution I.L

E7027method:lambda-arity

lambda parameter count mismatch

Fix
items->map(LAMBDA x: x + 1)

Constitution I.F

E7028method:lambda-return-type

lambda return type mismatch

Fix
items->filter(LAMBDA x: x > 0)

Constitution I.F

E7029method:auto-clone-with-returns

AUTO clone() must not declare RETURNS

Fix
CLASS Foo IMPLEMENTS Cloneable { AUTO METHOD clone() { } }

Constitution I.K

E7030method:lambda-uninferable

lambda signature cannot be inferred

Fix
METHOD run(LAMBDA f) RETURNS int32 { RETURN (f(0)) }

Constitution I.F

E7031method:lambda-non-parameter

LAMBDA allowed only as parameter type

Fix
METHOD apply(LAMBDA f) RETURNS int32 { RETURN (f(0)) }

Constitution I.F

E7032method:lambda-result-type

the lambda produces a type the receiver cannot accept

Fix
xs->map(LAMBDA (int32 v) { RETURN (v * 2) })     // yields int32

Constitution I.J

E7033method:lambda-param-mode

a LAMBDA parameter is always plain

Fix
METHOD map(LAMBDA func) RETURNS Array[T]   // the callee owns the closure

Constitution I.I.vi

E8000–E8999

22 codes · mostly string, convert, lex

E8002string:unterminated

Unterminated string — missing closing quote

Fix
String s = "hello world"

Constitution I.D

E8003string:escape

Invalid escape sequence in string literal

Fix
String s = "\n"  // or "\\q" for literal backslash-q

Constitution I.D

E8004string:dollar-plain

'$' in a plain string is a literal character

Fix
String msg := ("Hello $1")->format(name)

Constitution I.D

E8005string:format-placeholder

->format() placeholder out of range ($1–$9)

Fix
// Split into multiple format calls for > 9 args

Constitution I.D

E8006string:char-overflow

Char literal value exceeds Unicode range (U+0000–U+10FFFF)

Fix
char c = '\U+1F600'

Constitution I.D

E8008string:method-on-non-string

String method called on a non-String type

Fix
int32 len = myString->length()

Constitution I.D

E8009string:multiline-delimiter

Multi-line string must use the /" delimiter

Fix
String s = /"
line one
line two
"/

Constitution I.D

E8010string:format-type-mismatch

->format() argument type mismatches its placeholder

Fix
("Value: $1")->format(Convert->toString(myObject))

Constitution I.D

E8011string:format-no-placeholders

->format() args but no placeholders in string

Fix
("hello $1")->format(name)

Constitution I.D

E8012convert:to-int-unchecked

Convert->toInt32 STATUS must be checked

Fix
STATUS s
int32 n, s := Convert->toInt32(&str)
IF s IS FAILURE { handle() }

Constitution I.D

E8013string:equality-operator

'==' compares String references — use ->equals()

Fix
bool same = strA->equals(strB)

Constitution I.D

E8014string:mutation

String cannot be modified in place

Fix
String newStr := str->replace(str->charAt(0), 'H')

Constitution I.D

E8015string:char-index-out-of-bounds

->charAt() index is statically out of bounds

Fix
char c = "hi"->charAt(1)  // "hi" has indices 0 and 1

Constitution I.D

E8016string:char-vs-string

char expected — single-char string given

Fix
char c = 'a'

Constitution I.D

E8017string:format-missing-argument

placeholder has no matching argument

Fix
("$1 and $2")->format(arg1, arg2)

Constitution I.D

E8018string:comparison-case

case-sensitive comparison — use ->equalsIgnoreCase()?

Fix
bool ok = input->equalsIgnoreCase("yes")

Constitution I.D

E8019lex:numeric-literal-suffix

C/Rust numeric-literal suffixes are not valid

Fix
uint64 x = 14757395258967641293     // bare literal; LHS type sets the shape

Constitution I.C

E8020format:spec-type-mismatch

format() spec type-letter is incompatible with the argument type

Fix
int32 n = 255
("[$1:x]")->format(n)        // "ff"

Constitution stdio-spec.md#44-format-spec

E8021string:format-unused-argument

argument never referenced by any placeholder

Fix
("$1 and $2")->format(a, b)

Constitution I.D

E8022string:format-empty-spec

`:` after a placeholder opens a format spec, and none follows

Fix
("$1$: $2")->format(key, value)         // `$:` is a literal colon

Constitution I.D

E8023string:format-too-many-arguments

a format call takes at most nine arguments

Fix
("$1 $2 $3 $4 $5 $6 $7 $8 $9")->format(a, b, c, d, e, f, g, h, i)

Constitution I.F

E8024string:format-argument-confined

a FormatArgument may not outlive its format call

Fix
METHOD log(REFERENCE String tmpl, FormatArgument... args) { ... }   // take it only as a format parameter

Constitution I.F

E9000–E9999

62 codes · mostly module, emit, evir

E9001module:name-mismatch

manifest filename does not match module name

Fix, one of
  1. Update the json `name` to match the filename
  2. Rename the json file to match the `name`

Constitution I.N

E9002module:dependency-not-found

dependency path not found

Fix
{ "path": "../existing_module" }

Constitution I.N

E9003module:interfaces-ev-content

interfaces.ev holds only INTERFACE, GROUP, STRUCT

Fix
// Move CLASS MyHelper to MyHelper.ev

Constitution I.N

E9004module:structs-ev-content

structs.ev must contain only STRUCT declarations

Fix
// Move CLASS Config to Config.ev

Constitution I.N

E9005module:multiple-top-level

each .ev file must contain one CLASS

Fix
// Split into A.ev and B.ev

Constitution I.N

E9007module:group-wrong-file

GROUP declarations must go in interfaces.ev

Fix
// Move GROUP Status to interfaces.ev

Constitution I.N

E9008module:struct-shares-file

STRUCT must be alone or in structs.ev

Fix
// Put STRUCT Point in its own Point.ev (or in the structs.ev pool)

Constitution I.N

E9009module:no-ev-files

No .ev files found in module folder

Fix
// Add at least one .ev file with a CLASS or ENUM declaration

Constitution I.N

E9010module:duplicate-symbol

duplicate type name in the module

Fix
// Rename one of them

Constitution I.N

E9011module:circular-dependency

circular module dependency detected

Fix
// Introduce a shared third module C with no dependency on A or B

Constitution I.N

E9012module:unknown-target

build target must be executable or shared_library

Fix
{ "target": "shared_library" }

Constitution I.N

E9013module:manifest-malformed

<ModuleName>.json is missing a required field (name, version, target)

Fix
{ "name": "myapp", "version": "1.0.0", "target": "executable" }

Constitution I.N

E9014module:dependencies-malformed

dependencies.json must be a JSON array

Fix
[{ "path": "../other" }]

Constitution I.N

E9015module:no-entry-point

Executable module has no entry class

Fix
// Add start(String[] argv) RETURNS (int32 code) to one class

Constitution I.N

E9016module:multiple-entry-points

more than one class declares start()

Fix
// Remove start() from all but one class

Constitution I.N

E9017module:manifest-not-found

module manifest not found — expected <ModuleName>.json

Fix
// Create my_module.json: { "name": "my_module", "version": "1.0.0", "target": "executable" }

Constitution I.N

E9018module:transitive-dep-missing

transitive dependency could not be resolved

Fix
// Ensure all transitive dependencies are present and their paths are correct

Constitution I.N

E9019module:self-dependency

Module lists itself as a dependency

Fix
// Remove self-reference from dependencies.json

Constitution I.N

E9020module:duplicate-dependency

Dependency listed more than once in dependencies.json

Fix
[{ "path": "../libA" }]

Constitution I.N

E9021module:dependency-version

dependency version below the required minimum

Fix, one of
  1. Update the dependency
  2. Lower the version requirement

Constitution I.N

E9022module:empty-module

module's .ev files are all empty

Fix
// Add at least one CLASS, ENUM, STRUCT, INTERFACE, or GROUP

Constitution I.N

E9023module:clang-not-found

clang++ not found on PATH

Fix
// macOS: xcode-select --install
// Linux: apt-get install clang

Constitution I.N

E9024module:kernel-not-found

the kernel is not built or not staged

Fix
// build and stage it from the repo root:  make install

Constitution I.N

E9025module:ev-file-empty

source file declares no type

Fix
// Add: CLASS MyClass { METHOD run() { } }

Constitution I.N

E9026module:undeclared-dependency

used type's module is not in dependencies.json

Fix
// Add: { "path": "../libCore" } to dependencies.json

Constitution I.N

E9028module:clang-compile-error

clang++ rejected the generated C++

Fix
// Review error output above; check types, includes, and generated .cpp

Constitution I.N

E9031module:enum-wrong-file

ENUM declarations must go in enums.ev

Fix
// Move ENUM Color to enums.ev (alongside any other module-level ENUMs)

Constitution I.N

E9032module:executable-missing-entrypoint-json

executable module requires an entry point

Fix
Add "entrypoint": "<module>::Main::start" to the manifest

Constitution I.N

E9033module:shared-library-has-entrypoint-json

Shared-library modules cannot declare an entry point

Fix, one of
  1. Remove the entry point
  2. Change the target to `executable`

Constitution I.N

E9036module:entrypoint-class-not-found

the entry point names a nonexistent class

Fix, one of
  1. Declare `CLASS Main IMPLEMENTS TaskStarter`
  2. Point `entrypoint.json` at an existing class

Constitution I.N

E9037module:entry-class-not-threadstarter

Entry class must IMPLEMENTS TaskStarter

Fix
// CLASS Main IMPLEMENTS TaskStarter { ... }

Constitution I.N

E9039emit:unlowerable-construct

could not lower this construct to C++

Fix
// Rephrase/simplify the expression; report the case to the Envzn team

Constitution II.N

E9040module:kernel-type-shadow

module type may not shadow kernel names

Fix
// rename it:     CLASS NetBox { ... }

Constitution I.N

E9041module:reserved-envzn-name

module may not redeclare a reserved name

Fix
// rename it:  CLASS AppSystem { ... }

Constitution I.N

E9042module:evir-sidecar-invalid

dependency .evir sidecar is corrupt, stale, or written by another compiler

Fix, one of
  1. Rebuild the dependency
  2. Remove the stale .evir and rebuild

Constitution I.N

E9043module:native-dep-not-found

native dependency not found — buildFlags reference a missing ${PREFIX}

Fix
// install the library, or set the ${...}_PREFIX variable to an existing install

Constitution I.N

E9044module:multiple-manifests

module folder holds more than one manifest

Fix
// keep exactly one <ModuleName>.json; rename or remove the others

Constitution I.N

E9046module:library-has-entry-point

a shared_library may not define start(String[] argv)

Fix
// drop the parameter — METHOD start() — or make the module executable

Constitution I.N

E9047module:name-not-identifier

module name is not a legal identifier

Fix
// { "name": "myApp" }    // [A-Za-z][A-Za-z0-9_]*

Constitution I.N

E9048module:name-reserved

module name shadows a reserved ENVZN name

Fix
// { "name": "AppMath" }

Constitution I.N

E9049module:missing-module-declaration

every .ev file needs a MODULE declaration

Fix
// MODULE myLib      // below the header comment, before any declaration

Constitution I.N

E9050module:declaration-name-mismatch

MODULE declaration does not match the manifest name

Fix
// MODULE myLib      // match the manifest exactly, case included

Constitution I.N

E9051module:banned-build-flag

manifest build flag can execute code at build time

Fix
// Declare native code with FOREIGN BIND + a nativeSources TU;
// keep buildFlags to -I / -L / -l / -D

Constitution I.N

E9052module:read-escapes-module-root

source path escapes the module folder

Fix
// Keep every source inside the module folder — vendor the file in
// rather than pointing outside it

Constitution I.N

E9053module:dependency-path-escapes-project

dependency path escapes the project

Fix
// Install the dependency so it resolves by name, or move it
// inside the project — a sibling path like ../evTest is fine

Constitution I.N

E9054module:emit-target-unavailable

the selected emit target is not available

Fix
// Build with the C++ emitter: evc --emit=cxx myModule,
// or leave --emit off (and EV_EMIT unset) for the default

Constitution I.N

E9055module:entrypoint-key-malformed

the manifest "entrypoint" must be "<module>::<Class>::start"

Fix
// "entrypoint": "app::Main::start"

Constitution I.N

E9056module:entrypoint-method-not-start

the entry method must be start (the TaskStarter contract)

Fix
// "entrypoint": "app::Main::start"

Constitution I.N

E9057module:entrypoint-module-mismatch

the entry point names a module other than this one

Fix
// app.json: "entrypoint": "app::Main::start"

Constitution I.N

E9060module:thread-stack-size-invalid

the manifest "thread-stack-size" must be 512K to 32M, in steps of 16K

Fix
// "thread-stack-size": "8M"

Constitution I.N

E9061evir:type-without-module

a type left the verifier with no module

Fix
// Rewrite the statement nearby (e.g. declare the slot's type: `int32 q2, $? := f()`) and report the printed node path to the Envzn team

Constitution II.N

E9062module:template-unpublished

a dependency's template was not published in its headers

Fix
// Rebuild Lib with this compiler (`epm build Lib`), then rebuild this module

Constitution I.K.ix

E9063module:instantiation-filename-clash

two template instances would be written to the same file

Fix
// Rename one of the argument types so the two instances differ by more than case

Constitution I.K.ix

E9064module:c-catalog-missing

the module's C catalog is missing or out of date

Fix, one of
  1. Build the module with epm or make, which make the catalog before evc runs
  2. Make it by hand: python3 epm/tools/c_catalog.py <module> --force

Constitution I.N

E9065module:entrypoint-object-malformed

the "entrypoint" object needs "start", and may hold only "options" and "after-double-dash"

Fix
// "entrypoint": { "start": "app::Main::start", "options": { } }

Constitution I.N

E9066module:entrypoint-option-malformed

an option entry needs a "type", and holds only the option keys

Fix
// "name": { "type": "String", "help": "who to greet" }

Constitution I.N

E9067module:entrypoint-option-alias

an option "alias" is one unused letter, never "h"

Fix
// "name": { "type": "String", "alias": "n" }

Constitution I.N

E9068module:entrypoint-option-rule

an option breaks a rule of the entrypoint block

Fix
// "shout": { "type": "boolean" }   // a flag is never required or positional

Constitution I.N

E9069module:entry-class-has-init

the entry class declares no INIT; the runtime constructs it

Fix
// CLASS Main IMPLEMENTS TaskStarter {
//     METHOD start() RETURNS STATUS { ... }

Constitution I.N

E9070module:entry-option-field-kind

an options field must be blittable or String

Fix
// CLASS AppOptions IMPLEMENTS TaskStarterOptions {
//     String file

Constitution I.N

E9071module:entry-options-disagree

the entrypoint options and the options class disagree

Fix
// "options": { "name": { "type": "String" } }

Constitution I.N

E9072emit:dispatch-incomplete

a lens dispatcher has no case for a class (compiler defect)

Fix
// Report the case to the Envzn team with the program that triggered it

Constitution II.N

E10000–E10999

1 codes · mostly type

E10096type:implicit-conversion

implicit conversion may lose or reinterpret the value

Fix
n = big AS int32   // state the conversion (see conversions.html)

Constitution I.F

W2000–W2999

2 codes · mostly type, foreign

W2067type:return-slot-unused

named return slot is never referenced

Fix
METHOD foo() RETURNS (V value, STATUS status) {
    value, status := bar()
    RETURN (value, status)
}

Constitution I.K

W2146foreign:fixed-width-out-param

64-bit fixed-width out-param is platform-dependent

Fix
FOREIGN BIND f(LOAD C.size_t n)   // or C.long / C.ssize_t

Constitution I.D

W4000–W4999

2 codes · mostly concurrency

W4106concurrency:detached-scope-review

DETACHED CONCURRENT used (prefer widening the scope)

Fix
// Prefer wrapping the long-lived work in a wider CONCURRENT scope
// that survives as long as the work needs to.

Constitution I.L

W4108concurrency:hot-loop-no-yield

tight CONCURRENT loop has no cancellation check

Fix
CONCURRENT {
    WHILE NOT currentTask->isCancelled() { compute() }
}

Constitution I.L

W7000–W7999

1 codes · mostly method

W7020method:missing-override

method reimplements a concrete parent method but lacks OVERRIDE

Fix
CLASS Dog EXTENDS Animal { OVERRIDE METHOD speak() { } }

Constitution I.K

W8000–W8999

1 codes · mostly style

W8001style:string-concatenation

String '+' concatenation is non-idiomatic; prefer ->format()

Fix
String msg := ("hello $1")->format(name)

Constitution I.D

W9000–W9999

1 codes · mostly module

W9059module:entrypoint-not-fully-qualified

write the entry point in full: <module>::<Class>::start

Fix
// "entrypoint": "app::Main::start"

Constitution I.N

W10000–W10999

65 codes · mostly style, lint, type

W10001style:empty-block

Empty method body

Fix
METHOD run() { /* TODO: implement */ }

Constitution I.K

W10002style:unused-variable

Local variable declared but never used

Fix, one of
  1. Remove the declaration
  2. Use the value

Constitution ENVZN_USER_GUIDE.md III.B

W10003style:dead-code

dead code after RETURN

Fix
print("done")
RETURN 0

Constitution I.H

W10004style:missing-default

GROUP MATCH has no DEFAULT clause

Fix
MATCH status { WHEN SUCCESS: { } WHEN FAILURE: { } DEFAULT: { log("unhandled") } }

Constitution I.H

W10005style:unused-param

method parameter is never used

Fix, one of
  1. Remove the parameter
  2. Use it

Constitution I.K

W10006style:boolean-tautology

boolean expression is always true or false

Fix
bool ok = (x > threshold)

Constitution I.H

W10007style:large-param-list

method has more than 7 parameters

Fix
STRUCT RunConfig { int32 a
  String b
  ... }
METHOD run(RunConfig cfg)

Constitution I.K

W10008style:very-long-method

method body exceeds 100 lines

Fix
// Extract logical steps into helper methods

Constitution I.K

W10009style:dict-lookup-unchecked

Dictionary->lookup() STATUS must be checked

Fix
STATUS s
String val, s := myDict->lookup("key")
MATCH s { WHEN SUCCESS: { ... } WHEN FAILURE(msg): { ... } }

Constitution I.J

W10010style:deprecated-feature

deprecated language feature — see replacement

Fix
// See DEPRECATED note for guidance

Constitution I.A

W10011style:complex-condition

complex conditional has more than 3 clauses

Fix
boolean ready = .isReady(a, b, c, d)
IF ready THEN { }

Constitution I.H

W10012style:enum-match-non-exhaustive

Enum MATCH does not cover all cases

Fix
MATCH color { WHEN RED: { } WHEN GREEN: { } WHEN BLUE: { } }

Constitution I.H

W10013style:empty-catch

Empty RECOVER block silently swallows errors

Fix
RECOVER (FileNotFoundError e) { log(e.message) }

Constitution I.M

W10014style:return-value-ignored

return value silently discarded

Fix
$? := obj->parse(data)  // explicit discard

Constitution I.M

W10015style:loop-nesting

loop nesting exceeds 3 levels

Fix
// Extract inner loops into helper METHOD

Constitution I.H

W10016style:magic-number

magic number in expression

Fix
int32 SECONDS_PER_DAY = 86400
int32 timeout = SECONDS_PER_DAY

Constitution ENVZN_USER_GUIDE.md III.B

W10017style:boolean-parameter

boolean parameter suggests two different behaviours

Fix
ENUM ProcessMode { STRICT, LENIENT }
METHOD process(ProcessMode mode) { }

Constitution I.K

W10018style:redundant-not

double negation (NOT NOT) is redundant

Fix
bool ok = isValid

Constitution I.H

W10019style:constant-in-loop

Constant expression in loop condition

Fix, one of
  1. Use a meaningful loop condition
  2. `BREAK` with a conditional inside

Constitution I.H

W10020style:single-element-collection

Collection initialized with a single element

Fix
int32 value = 42  // or keep as array if more elements expected

Constitution I.J

W10022style:method-length

method body exceeds 50 lines

Fix
METHOD process() { step1()
  step2()
  step3() }

Constitution I.K

W10023style:nested-lambda

nested lambda — extract into a method

Fix
// Extract inner lambda to METHOD isMatch(x, y)

Constitution I.F

W10024style:redundant-override

OVERRIDE body is identical to the parent

Fix
// Remove override; parent implementation is already used

Constitution I.K

W10025style:field-never-written

field set in INIT, never written again

Fix
// This field behaves like a constant; document that it is immutable

Constitution I.K

W10026style:naming-convention

type names should use PascalCase

Fix
CLASS MyClass { }

Constitution I.D.ix

W10027style:method-naming

method name should be a camelCase verb

Fix
METHOD processData() { }

Constitution ENVZN_USER_GUIDE.md III.B

W10028style:abbreviated-name

(retired) abbreviated-name style nag

Fix
int32 width, height, depth = compute()

Constitution ENVZN_USER_GUIDE.md III.B

W10029style:missing-return-type

method has no RETURNS annotation

Fix
METHOD getCount() RETURNS (int32 n) { RETURN count }

Constitution I.K

W10030style:method-chaining

long method chain (4+ calls)

Fix
Intermediate mid = a->b()->c()
result = mid->d()->e()

Constitution I.K

W10031style:resource-no-cleanup

resource-opening class has no CLEANUP block

Fix
CLASS FileWrapper { METHOD open() { handle = openFile() } CLEANUP { handle->close() } }

Constitution I.I

W10032style:redundant-type

type annotation restates the right-hand side

Fix
int32 x = 5

Constitution I.E

W10034style:file-name-convention

file name does not match declared type

Fix
// Rename file to MyClass.ev

Constitution I.N

W10035style:status-unchecked

STATUS assigned but never checked

Fix
STATUS s = doWork()
IF s IS FAILURE { handleError() }

Constitution I.M

W10036style:cleanup-in-method

Resource cleanup done manually in a method

Fix
CLASS FileUser { File f
  CLEANUP { f->close() } }

Constitution I.I

W10037style:format-string-concat

String concatenates more than 3 literals

Fix
String msg := ("Part $1 of $2 complete")->format(part, total)

Constitution I.D

W10038style:interface-single-method

Interface declares only one method

Fix
// Consider if this interface will grow; single-method interfaces are sometimes fine

Constitution I.K

W10039style:field-never-read

field written in INIT but never read

Fix, one of
  1. Remove the field
  2. Use it

Constitution I.K

W10040style:large-class

Class has more than 20 methods

Fix
// Extract sub-responsibilities: Parser, Emitter, Analyzer as separate classes

Constitution I.K

W10041style:enum-raw-values-mixed

(retired) enum mixed-raw-values warning

Fix
ENUM Status { OK = 200, ERR = 500 }

Constitution I.K

W10042style:catch-and-rethrow

RECOVER immediately re-PANICs without modification

Fix
// Let the error propagate naturally; remove the TRY/RECOVER

Constitution I.M

W10043style:group-single-member

GROUP has only one member type

Fix
// Use SuccessData directly; GROUP needs 2+ variants to be useful

Constitution I.K

W10044style:deep-inheritance

Inheritance chain is 4+ levels deep

Fix, one of
  1. Flatten via composition
  2. Use interfaces

Constitution I.K

W10045style:lambda-complex-body

lambda block body exceeds 10 lines

Fix
items->map(LAMBDA x: transform(x))
METHOD transform(T x) RETURNS (T result) { /* 15 lines */ }

Constitution I.F

W10047type:fixed-array-size-large

Fixed-size array bound exceeds 1024

Fix
Token[] tokens         // opaque, heap-managed
// or keep T[N] if N is genuinely fixed and the per-instance size is acceptable

Constitution I.J

W10050style:nested-type-unused

PRIVATE nested ENUM / STRUCT never used

Fix
CLASS UTFCodec { PRIVATE ENUM State { BEGIN, ERROR } METHOD step() RETURNS State { ... } }

Constitution I.K

W10060lint:empty-block

empty IF / ELSE-IF body — the branch does nothing

Fix
remove the empty branch, or fill in the intended work

Constitution I.H

W10061lint:empty-block

empty ELSE body — the else branch does nothing

Fix
drop the empty ELSE, or fill in the intended work

Constitution I.H

W10062lint:empty-block

empty loop body — the loop does nothing

Fix
fill in the loop body, or remove the loop

Constitution I.H

W10063lint:empty-block

empty MATCH arm — this case does nothing

Fix
fill in the arm, or fold the empty case into another

Constitution I.H

W10064lint:empty-block

empty RECOVER body — the error is silently swallowed

Fix
handle the error (log / rethrow / recover), do not swallow it

Constitution I.M

W10065lint:empty-block

empty FINALLY body — the clause does nothing

Fix
remove the empty FINALLY, or add the cleanup it should run

Constitution I.M

W10066lint:empty-block

empty anonymous block — { } does nothing

Fix
remove the empty block

Constitution I.H

W10067lint:empty-block

empty method body — the method does nothing

Fix
fill in the body, or remove the method if it is unused

Constitution I.K

W10068lint:const-condition

constant IF condition (always TRUE or always FALSE)

Fix
use a real condition, or remove the dead branch

Constitution I.H

W10069lint:match-chain

long IF/ELSE-IF chain; consider a condition-role MATCH

Fix
MATCH { WHEN a: {} WHEN b: {} WHEN c: {} WHEN d: {} }

Constitution I.H

W10070lint:param-mutation

MODIFY method called on a class-typed value parameter (may not emit)

Fix
METHOD f(MUTABLE REFERENCE Widget w) RETURNS STATUS { w->resize(2) }

Constitution I.I

W10071lint:unused-dependency

declared module dependency is never referenced

Fix
remove the unused dependency from the manifest

Constitution ENVZN_USER_GUIDE.md III.B

W10085style:nested-control-flow

(retired) nested-IF-depth style nag

Fix
boolean ok = .allHold(a, b, c)
IF ok THEN { }

Constitution I.H

W10086memory:reference-structural-advisory

REFERENCE binding satisfies neither structural safety condition

Fix
._ref =@ ._ownedChain.field  // SELF-reachable

Constitution I.I

W10090format:argument-not-formattable

format() argument does not implement Formattable, so it may print [??]

Fix
CLASS Person IMPLEMENTS Formattable {
    String name
    METHOD toString() RETURNS String { RETURN (.name) }
}
("name: $1")->format(somePerson)  // "name: Alice"

Constitution I.F

W10091memory:over-retention

reference or handle held past its last use

Fix
// bind c in the block that uses it, so it releases at block exit

Constitution I.I

W10093analyzer:when-is-undecidable-at-compile-time

`WHEN <value> IS <Type>` not compile-time decidable

Fix
GROUP Shape { Circle, Square }
MATCH figure { WHEN Circle c: ... WHEN Square s: ... }

Constitution I.K

W10094ndarray:cache-hostile-loop

inner loop strides the slow N-D axis

Fix
FOR j ...: FOR i ...: x = a[i,j]   // i inner walks the contiguous axis-0

Constitution I.J

W10095type:implicit-char-conversion

implicit cross-char-type conversion may change the code unit

Fix
char16 u = c8 INTO char16   // explicit (use AS for a narrowing)

Constitution I.D

W10097arith:provable-overflow

this arithmetic overflows its declared type for the values it can hold

Fix
int16 c = a + a    // widen the receiver, or mask/convert the operands

Constitution I.F