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
CLASS App { METHOD start(String[] argv) RETURNS (int32 code) { } }
Constitution I.E
E1002parse:literal
Unterminated char literal — missing closing quote
char c = 'a'
Constitution I.C
E1003parse:lexer
Unexpected character — not a valid token
int32 x = 5 + 3
Constitution I.C
E1005parse:assignment
expected an assignment operator — `=`, `:=`, or `=@`
// insert the operator: `=` value · `:=` ownership · `=@` referenceConstitution I.G
E1006parse:exception
expected 'as' after error type in CATCH
CATCH (IOException as e) { }Constitution I.M
E1007parse:status
Expected SUCCESS, FAILURE, or PARTIAL_SUCCESS after IS
IF result IS SUCCESS { }
Constitution I.M
E1008parse:class-body
Unexpected token in class body
CLASS Foo { int32 x METHOD run() { } }
Constitution I.K
E1009parse:expression
Unexpected token in expression
int32 x = 2 * 3
Constitution I.F
E1011parse:method-sig
method signature — expected a parameter list
METHOD run() { }Constitution I.K
E1012parse:eof
unexpected end of file
CLASS Foo { }
Constitution I.E
E1013parse:when
Expected colon after WHEN pattern
WHEN Status s: { }
Constitution I.H
E1014parse:identifier
Expected identifier here
CLASS MyClass { }
Constitution I.E
E1015parse:type
Expected type reference here
METHOD run() RETURNS (int32 result) { }
Constitution I.D
E1018parse:params
Unexpected token in method parameter list
METHOD run(int32 x) { }
Constitution I.K
E1019parse:keyword
Reserved keyword used as identifier
int32 myClass = 5
Constitution I.E
E1020parse:underscore
leading '_' is reserved for compiler identifiers
int32 count = 0
Constitution I.E
E1021parse:enum-case
Invalid ENUM case syntax
ENUM Color { RED, GREEN, BLUE }
Constitution I.K
E1022parse:for
Invalid FOR loop syntax
FOR i = 0 TO 10 { }
Constitution I.H
E1023parse:lambda
lambda needs a parameter list or block
String[] items = items->filter(LAMBDA x: x.length() > 0)
Constitution I.F
E1024parse:duplicate-field
Duplicate field declaration in class body
CLASS Foo { int32 x int32 y }
Constitution I.K
E1025parse:match
invalid MATCH — expected target or brace
MATCH value { WHEN 1: { } }
Constitution I.H
E1026parse:semicolon
semicolons are not valid in Envzn
int32 x = 5 int32 y = 6
Constitution I.G
E1027parse:numeric-literal
numeric literal out of range for type
uint8 x = 0xFF // max value for uint8
Constitution I.D
E1028parse:numeric-underscore
numeric-literal underscore must appear between digits
int32 x = 1_000
Constitution I.D
E1030parse:loop-syntax
Invalid DO/REPEAT loop — expected condition expression
DO { work() } REPEAT WHILE cond
Constitution I.H
E1031parse:optional-suffix
'?' is not valid in a declaration
String name = EMPTY
Constitution I.D
E1032parse:grammar
source does not match the grammar here
METHOD run() RETURNS (int32 code) { }
Constitution I.E
E1033parse:non-ascii-identifier
identifier must be ASCII letters, digits and underscore only
int32 cafe = 1 // Unicode is welcome in strings and comments, not in names
Constitution I.C
E1034parse:octal-literal
octal literal is not supported
int32 legacy = 493 // decimal, or 0x1ED in hex
Constitution I.C
E1080parse:constant-modifier
CONSTANT composes only with PRIVATE, SHARED, INTERNAL
PRIVATE CONSTANT int32 LIMIT = 1024
Constitution I.K
E1081parse:constant-no-init
CONSTANT field requires an initializer (`= <literal>`)
CONSTANT float64 PI = 3.14159
Constitution I.K
E1082parse:constant-not-literal
CONSTANT initializer must be a literal
CONSTANT int32 N = 6
Constitution I.K
E1083parse:constant-bad-type
CONSTANT allowed only on primitives and String
// CONSTANT supports primitives + String only; use a regular field for class typesConstitution I.K
E1084parse:constant-type-mismatch
CONSTANT initializer type mismatches the field
CONSTANT String N = "hello" // or CONSTANT int32 N = 42
Constitution I.K
E1085parse:self-reserved
SELF is a reserved word here
// 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
PRIVATE CONSTANT uint8[4] masks = [ 0xFF, 0x7F, 0x3F, 0x1F ]
Constitution I.K
E1090parse:cf-bare-needs-marker
simple conditional needs parentheses or THEN/DO
Add `THEN`/`DO`: `IF x > 5 THEN { ... }`
Constitution I.H
E1091parse:cf-compound-needs-clause-parens
mixed-operator clauses must be parenthesized
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
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
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
// 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
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
SINGLETON CLASS Math { CONSTANT float64 PI = 3.14159 }
Constitution I.K
E1100analyzer:singleton-data-field
SINGLETON CLASS declares a data field
NAMESPACE Config { CONSTANT int32 BASE = 10 }
Constitution I.K
E1101analyzer:singleton-modify-method
SINGLETON CLASS methods may not be MODIFY
SINGLETON CLASS System { METHOD exit(int32 code) { ... } }
Constitution I.K
E1102analyzer:singleton-inheritance
a SINGLETON CLASS may neither inherit nor be inherited
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()
SINGLETON CLASS Math { CONSTANT float64 PI = 3.14159 }
Constitution I.K
E1104analyzer:when-type-kind-mismatch
WHEN keyword mismatches the type's kind
WHEN shape IMPLEMENTS Drawable { } ELSE { }
Constitution I.K
E1105analyzer:when-is-group-unsupported-v1
WHEN IS <Group> requires a local group
WHEN T IMPLEMENTS Collectable { } ELSE { } // or test a concrete class / PRIMITIVE
Constitution I.K
E1106analyzer:namespace-arrow-method
NAMESPACE methods use `.`, not `->`
Math.sqrt(2.0)
Constitution I.N
E1107analyzer:namespace-variable-field
NAMESPACE may declare only CONSTANT fields
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
NAMESPACE Util { METHOD f() {} }
Constitution I.N
E1109analyzer:namespace-scope-resolution
NAMESPACE members use `.`, not `::`
Math.PIConstitution I.N
E1111syntax:reference-requires-rebind-op
REFERENCE assignment requires `=@`
REFERENCE T value =@ iter->next()Constitution I.I
E1112analyzer:iterator-as-field
an iterator-implementing class cannot be a data field
Use the iterator as a method-localConstitution I.J
E1113analyzer:iterator-class-fields
an iterator-implementing class cannot have class-typed data fields
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 `?`
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
CLASS Fleet { INTERNAL REFERENCE Widget active }
Constitution I.I
E1116parse:bitwise-comparison-mix
bitwise and comparison operators need parenthesized grouping
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
// 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
int32 x = (a + b) * c // keep nesting shallow
Constitution I.G
E1119analyze:definite-return
non-void method can fall through without RETURN
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
INIT(Widget w) { .target =@ w }
Constitution I.I
E1121reference:init-unassigned
REFERENCE field not bound with =@
CLASS Holder { REFERENCE Widget w INIT(Widget src) { .w =@ src } }
Constitution I.I
E1122reference:rebind-non-ref
=@ used on a non-REFERENCE field
INIT(Widget src) { .w := src }
Constitution I.I
E1123parse:continuation-layout
a continuation keyword after a multi-line block must start its own line
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 `.`
widget->equals(other) // `->` is the method callConstitution I.F.i
E1130hidden:no-interface
HIDDEN class must IMPLEMENTS or EXTENDS abstract
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
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
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
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
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
float64[m,n] // all axes sized (runtime shape)
Constitution I.J
E1136discard:as-argument
`$?` is a return-discard, not a call argument
obj->foo(x) // pass a real value; $? only discards a returnConstitution I.M
E1137discard:as-parameter
`$?` is not a valid parameter name
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
$? := 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
IF (x > 3) THEN { printline("big") } // keywords are uppercase
Constitution I.H
E1140parse:status-in-comma-return
STATUS cannot be a comma member
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
INTERNAL CLASS Shape { } // concrete class, enum, or struct
Constitution I.E
E1142reference:mutable-not-standalone
MUTABLE qualifies REFERENCE — it is not standalone
MUTABLE REFERENCE int32 count
Constitution I.I
E1143reference:not-applicable-here
REFERENCE does not apply to this declaration
int32 slot // drop the REFERENCE prefix
Constitution I.I
E1144reference:shape-conflict
REFERENCE combined with an incompatible qualifier
MUTABLE REFERENCE Node peer // pick one reference shape
Constitution I.I
E1145template:malformed-qualifier
malformed TEMPLATE qualifier
TEMPLATE: GIVEN TYPE T IS Cloneable:
Constitution I.K
E1146template:constraint-mismatch
each declared type parameter needs exactly one constraint
TEMPLATE: GIVEN TYPES K, V IS K Cloneable, V Cloneable:
Constitution I.K
E1147template:singular-form
plural form used for a single item
TEMPLATE: GIVEN TYPE T IS Cloneable:
Constitution I.K
E1148template:qualifier-placement
TEMPLATE qualifier must sit on a generic declaration
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
HOTLOOP FOR i = 0 UNTIL items.length { }
Constitution I.H
E1150parse:assert-form
ASSERT needs a one-line condition and a message
ASSERT(depth < limit) => "depth exceeded the limit"
Constitution I.M
E1151loop:loop-form
LOOP has one form: LOOP e IN c WITH INDEX i
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
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
METHOD find(int32 k) RETURNS (int32 v | STATUS s)
Constitution I.M
E1154parse:conversions-body
a CONVERSIONS host declares AS/INTO operators
CONVERSIONS TextConverter { OPERATOR INTO (FROM String) RETURNS ByteBuffer { } }
Constitution I.N
E1155parse:namespace-body
a NAMESPACE holds methods and CONSTANT fields only
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
FOREIGN_TYPE (struct sqlite3)Constitution I.N
E1157parse:match-type-subject
a type-check MATCH subject must be a simple variable
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
MATCH s { WHEN IS Circle: { } }
Constitution I.H
E1159analyzer:value-class-array-no-default
a VALUE CLASS array element needs an INIT()
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
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
WHEN T IS VALID DO { } ELSE { }
Constitution I.K
E1162parse:when-missing-else
WHEN ... DO requires a mandatory ELSE arm
WHEN T IS VALID DO { } ELSE { } // ELSE may be empty
Constitution I.K
E1163parse:reserved-keyword-unimplemented
reserved keyword with no V1 implementation
FOR x IN items { } // FOREACH is reserved for V3 — use FOR … IN
Constitution I.C
E1164parse:keyword-superseded
this keyword spelling has been superseded
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
{ total, } // a set — or add statements to make it a blockConstitution I.J
E1166parse:set-literal-no-destination
a set literal at statement position has nowhere to go
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
$? := call() // or: $?, name := f()
Constitution I.M
E1168parse:toplevel-placement
this declaration belongs at the top of the file
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
FOREIGN BIND ev_read(int32 fd) SETS_ERRNO(-1)
Constitution I.N
E1170parse:modifier-duplicate
this modifier is given twice
// remove the repeated modifier — one occurrence is the whole meaningConstitution I.N
E1171parse:foreign-type-bind-form
FOREIGN_TYPE BIND takes `opaque <Name>` or `(<c++ type>) <Name>`
FOREIGN_TYPE BIND (std::mutex) Handle // or: BIND opaque Handle
Constitution I.N
E1172parse:modifier-class-only
this modifier applies only to a CLASS
HIDDEN CLASS Point { } // or: VALUE CLASS Point { }
Constitution I.J
E1173parse:value-class-combination
VALUE CLASS is a concrete leaf — it takes neither modifier
VALUE CLASS Point { }
Constitution I.J
E1174parse:numeric-literal-malformed
this numeric literal is missing or misusing its digits
0x1F · 0b1011 · 1.5e-3
Constitution I.C
E1175parse:foreign-type-field-form
a FOREIGN_TYPE field binds one non-pointer C++ type
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
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 `.`
FOR x IN coll->iterator() { }
Constitution I.J
E1178parse:call-on-non-callable
only a name or a field access can be called
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
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
AUTO METHOD clone() { }
Constitution I.J
E1182syntax:shared-field
SHARED on a field is only valid as SHARED MUTABLE REFERENCE
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
int32 x = 42
Constitution I.D
E2005ambiguity:match-form
ambiguous MATCH — EMPTY vs GROUP dispatch
Add `WHEN EMPTY` — 'cfg' may be absentGROUP dispatch — Type1/Type2 are variants; code is valid
Constitution I.H
E2007type:narrowing
narrowing conversion requires IS or Convert
IF bigValue AS int8 THEN { int8 small = $RETURNED }
Constitution I.D
E2009type:reserved-complex
complex_* types are reserved for V2
// Use float64 for now; complex types arrive in V2Constitution I.D
E2013type:box-null
Box[T] field accessed before assignment
Box[Node] next = CREATE Node() Node n = next.value
Constitution I.J
E2014type:box-optional
Box[T] always holds a value
Box[Node] next := CREATE Node() // Box is always present; drop the `?`
Constitution I.J
E2015type:enum-case
Enum case used as wrong type
Color c = REDConstitution I.K
E2016type:class-inference
Cannot CREATE a GROUP type
Assign the variant directly — no CREATE for a GROUPCREATE a concrete class that belongs to the GROUP
Constitution I.K
E2017type:return-mismatch
returned type does not match declared type
METHOD getCount() RETURNS (int32 n) { RETURN 5 }
Constitution I.K
E2019type:operator
Operator not valid for this type
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
Use `:=` for a runtime-computed valueAssign a string literal and keep `=`
Constitution I.G
E2021type:arg-type
Argument type does not match parameter type
print(Convert->toString(42))
Constitution I.K
E2022type:collection-element
collection elements must share one type
int32[] nums = [1, 2, 3]
Constitution I.J
E2023type:method-on-primitive
cannot call a method on a primitive
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
MyClass x = CREATE MyClass() int32 y = x.value
Constitution I.K
E2025type:comparison
Incompatible types in comparison
bool ok = Convert->toString(5) == "five"
Constitution I.F
E2027type:v2-cursor
Cursor[T] is reserved for V2
// Use Iterator[T] for V1 iteration; Cursor arrives in V2Constitution I.J
E2028type:v2-stream
Stream[T] is reserved for V2
CHANNEL[Order] feedConstitution I.L
E2029type:non-void-discard
expression result discarded — use '$?'
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
// This feature is deferred to V2; use supported V1 typesConstitution I.D
E2031type:bitwise-non-integer
bitwise/shift/rotate operators require integer operands
Convert the operand to an integer firstUse a different (non-bitwise) operator
Constitution I.F
E2032type:incdec-non-numeric
`++`/`--` require a numeric primitive operand
int32 i = 0 i++
Constitution I.F
E2033type:incdec-non-lvalue
`++`/`--` require an lvalue operand
int32 sum = a + b
sum++Constitution I.F
E2034type:setop-non-set
set-algebra operators require Set-typed operands
// Both sides must be {T}-typed; lift the scalar into a set firstConstitution I.J
E2035type:setop-elem-mismatch
set-algebra operands must share an element type
// Both sides must be {T} with the same TConstitution I.J
E2036type:setop-non-cloneable-elem
class-element set algebra requires Cloneable elements
// Add `IMPLEMENTS Cloneable` (with AUTO METHOD clone() {}) to TokenConstitution I.J
E2037type:dict-key-not-hashable
Dictionary key class needs Hashable + Equatable
Implement `Hashable` + `Equatable` on the key typeUse a primitive key
Constitution I.J
E2038type:redundant-implements
subclass redeclares an interface its parent provides
CLASS Dog EXTENDS Animal { ... AUTO METHOD clone() RETURNS Dog { } }
Constitution I.K
E2039type:cloneable-subclass-no-clone
Cloneable subclass must declare its own clone()
// AUTO METHOD clone() RETURNS Dog { } — synthesised body copies Dog's own fieldsConstitution I.K
E2040type:fixed-array-as-param
fixed-size array `T[N]` cannot be a parameter
Pass an opaque vector `int32[]`
Constitution I.J
E2041type:fixed-array-as-return
fixed-size array `T[N]` cannot be returned
Return an opaque vector `int32[]`
Constitution I.J
E2042type:fixed-array-bound-unresolved
fixed-array bound: int literal or CONSTANT
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
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
int32[4] arr // any int literal >= 1
Constitution I.J
E2045type:fixed-array-size-cap
Fixed-size array bound exceeds 32768
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
// 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
REFERENCE int32[4] alias =@ original
Constitution I.J
E2048type:fixed-array-cell-bind-owning
cell-level `=@` forbidden on an owning fixed-array
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
// Make Token IMPLEMENTS Cloneable (with AUTO METHOD clone()) or assign via CREATEConstitution I.J
E2050type:atomic-bad-T
Atomic[T] requires a lock-free primitive T
// 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
int32 x = 0 // declare/spell the variable correctly
Constitution I.G
E2052return:missing-value
value-returning method hit a bare RETURN
METHOD get() RETURNS STATUS { RETURN (SUCCESS) }
Constitution I.G
E2053return:arity-mismatch
RETURN value count differs from the declaration
METHOD f() RETURNS (STATUS s, int32 n) { RETURN (SUCCESS, 5) }
Constitution I.G
E2054type:cxx-noncopyable
_cxx* type cannot be copied, moved, stored
// 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
// _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
int32[] a = [5, 6] int32 b = a[0] // index an array
Constitution I.J
E2057type:create-arg-mismatch
CREATE argument count matches no INIT
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
// 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
// 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`
ByteBuffer c := bb1->concat(bb2) // explicit named method
Constitution I.F
E2061type:op-arith-class-unsupported
this operator is not overloadable on a class
Matrix m := a->negate() // use a named method
Constitution I.F
E2062type:print-builtin-arity
wrong argument count to a print builtin
formatPrintline("{0} {1}", "hello", 5) // template + args
Constitution I.G
E2063type:storage-noncopyable
storage shorthand cannot be copied or moved
// 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
// 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}
// {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
// 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
CLASS Foo IMPLEMENTS Cloneable { METHOD clone() RETURNS Foo { ... } }
Constitution I.K
E2069type:eq-on-class
`==`/`!=` on classes is unsupported (V1)
IF a->equals(b) THEN { ... } IF NOT a->equals(b) THEN { ... }
Constitution I.F
E2070type:opaque-not-parametric
`opaque` is not a parametric type
opaque d := opaque[Esquire]->wrap(myEsquire)
Constitution I.D
E2071type:opaque-bare-in-expr
Bare `opaque` is not a value
opaque d := opaque[Esquire]->wrap(myEsquire)
Constitution I.D
E2072type:opaque-static-call-required
opaque[T] must be followed by ->wrap or ->unwrap
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
int32 x, int32 y := p->two()
Constitution I.G
E2074type:create-arg-type
CREATE argument type does not match the INIT parameter
Widget w = CREATE Widget(7)
Constitution I.K
E2075type:rebind-non-class-source
=@ source must be a valid place
// =@ 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
CLEANUP { /* do not read self-REFERENCE fields here */ }
Constitution I.I
E2077return:void-returns-value
a VOID method cannot return a value
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
Unwrap the value into a local or field, then call the method on itOn the opaque itself, call only loaded() or clone()
Constitution I.D
E2079init:class-field-unassigned
every class-typed field needs INIT assignment
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
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
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
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
Array[uint8] flags := CREATE Array[uint8]()
Constitution I.K
E2084type:power-non-numeric
the power operator `^` requires numeric operands
int32 n := 2 ^ 10 // numeric base and exponent
Constitution I.F
E2085type:factorial-non-integer
the factorial operator `!` requires an integer operand
int64 n := 5! // 120
Constitution I.F
E2086conversion:no-such-conversion
no conversion operator for this source/target pair
String s = count INTO String // a declared NumberConverter conversion
Constitution conversion-operators-design.md
E2087conversion:lossless-required
`INTO` needs a lossless conversion; use `AS`
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
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
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
FOREIGN BIND f(ByteBuffer buf) RETURNS int32
Constitution II.L
E2091foreign:non-boundary-return
FOREIGN BIND return cannot cross the boundary
FOREIGN BIND f() RETURNS int32
Constitution II.L
E2092foreign:bytebuffer-return
ByteBuffer is parameter-only across a FOREIGN BIND
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
FOREIGN BIND f() RETURNS String $*
Constitution II.L
E2094foreign:sets-errno-shape
SETS_ERRNO must declare its pipe: RETURNS (T value | STATUS status)
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
FOREIGN BIND CONSTANT int32 O_RDONLY
Constitution II.L
E2096foreign:struct-non-boundary-field
FOREIGN BIND STRUCT needs all boundary-typed fields
STRUCT R { int32 count int64 checksum }
Constitution II.L
E2097foreign:conflicting-redeclaration
FOREIGN BIND name redeclared with different signatures
// declare open(...) with one identical signature in each fileConstitution II.L
E2098type:value-array-non-blittable-element
value-array element type is not blittable; use Array[T]
Array[Token] tokens // class-typed array — heap with handles
Constitution I.J
E2099type:storage-shorthand-not-array-class
storage shorthand is minimal — use Array
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
Move the declaration into a `FOREIGN BIND`
Constitution II.L
E2101foreign:load-ineligible-type
LOAD admits only a value-array parameter
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
Pass a named local, then use it after the callFor 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
CLASS MyClass IMPLEMENTS Cloneable { } // name a declared interface
Constitution I.E
E2104opaque:bad-static-op
static opaque[T]-> call names neither wrap nor unwrap
String s := opaque[String]->unwrap(box) // wrap / unwrap only
Constitution I.D
E2105conversion:lossy-on-lossless
this conversion is lossless — use `INTO`
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
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
ALIAS Json::JsonWriter // an existing dep type
Constitution I.G
E2108alias:ambiguous
ALIAS short name collides with a local type or another alias
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
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
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
TEMPLATE: GIVEN TYPE T IS Comparable:
Constitution I.K
E2112template:except-on-non-group
`EXCEPT (...)` follows only GROUP or PRIMITIVE
Replace the bound with a GROUP that lists its members
Constitution I.K
E2113template:except-bad-member
EXCEPT name is not a GROUP member
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
Array[int32] // int32 is in PRIMITIVE and not excepted
Constitution I.K
E2115shared-class:not-shareable
A SHARED CLASS must `IMPLEMENTS Shareable`
SHARED CLASS Channel[T] IMPLEMENTS Shareable { ... }
Constitution I.K
E2116shared-class:field-not-private
SHARED CLASS data fields must be PRIVATE
SHARED CLASS Channel[T] { PRIVATE int32 depth ... }
Constitution I.K
E2117shared-ref:referent-not-shared-class
SHARED MUTABLE REFERENCE requires a SHARED CLASS
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`
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
boolean b = x ≈ 3.0 // numeric operands
Constitution I.F
E2120type:complex-literal-unparenthesized
a two-part complex literal must be parenthesized
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
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
a[i, j] // one coordinate per axisConstitution I.J
E2123ndarray:invalid-dimension
N-D array fixed extent must be positive
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]
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
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
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
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
p := c->parse(t) // drop the type argumentsConstitution I.K
E2130shift:count-out-of-range
shift count exceeds operand bit width
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
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
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
v := Codec.parse[Person](t) // supply exactly one
Constitution I.K
E2134arith:wrapping-operand-not-integer
wrapping operators &+ &- &* require fixed-width integer operands
int64 r = a &* b // integer operands wrap mod 2^n
Constitution I.F
E2135octet:scaling
an octet has no multiplication, division, remainder or power
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
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
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
FOREIGN::write(fd, buf, n)Constitution II.L
E2139octet:not-a-number
an octet is not a number — convert it with INTO
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
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
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
// UNSAFE.HANDLE h = EMPTY // HANDLE, MUTEX, CONDVAR, ...Constitution I.E
E2143foreign:c-type-outside-bind
C-ABI type is FOREIGN-declaration only
METHOD helper(uint64 n) RETURNS STATUS
Constitution I.D
E2144octet:not-a-counter
only an integer can be a counter or an index
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
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
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)
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
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
IF count != 0 THEN { } // say what you are testing
Constitution I.D.i
E2150char:not-a-number
a code point is not a number
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
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
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
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
Add an integer parameter named for its length — `C.size_t length`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
CLASS Grow[T] { Grow[T] next }
Constitution I.K
E2156type:unresolved-after-substitution
Name does not resolve for this instantiation
// Narrow the use with WHEN T IMPLEMENTS …, or tighten the qualifier so every T has itConstitution I.K
E2157module:internal-type-from-other-module
Another module's INTERNAL type is not visible here
// Use Lib's public surface, or make Frame public in LibConstitution I.N
E2158template:foreign-type-atom-outside-kernel
FOREIGN_TYPE qualifier atom is kernel-only
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
Bind one LOAD array per call, so `count` names the one C fillsRename 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
Return the count as an integer type (`int32`, `C.ssize_t`)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
If the name is right, delete build/c-catalog.json and rebuild: the catalog predates this bindingIf 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
Bind every parameter the C declaration has, in its orderRemove RETURNS when the C function returns void
Constitution I.N
E2163foreign:c-scalar
a value's width or sign differs from the C declaration
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
Bind an array of exactly the element type C points atBind a FOREIGN_TYPE whose C spelling names that type
Constitution I.N
E2165foreign:c-wide-void
an array wider than bytes crosses as void *
Bind a byte array (binary, int8, uint8, char8) where C takes void *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
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
Declare a type the constant's value fitsIf 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()
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
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
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
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
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
complex w := zConstitution I.D
E2174foreign:element-fact-outside-kernel
`ELEMENT OF T` is a kernel-only FOREIGN BIND parameter
// a module uses T[] and its methods; `LAYOUT OF T` (size and alignment) is legal anywhereConstitution I.N
E2175type:return-narrowing
a RETURN may widen its value, never narrow it
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
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
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
Return by valueUse `Box[T]` for heap-allocated sharing
Constitution I.I
E3005memory:cleanup-missing
Resource type requires CLEANUP block
CLASS File { METHOD open() { handle = openFile() } CLEANUP { closeFile(handle) } }
Constitution I.I
E3006memory:box-uninitialized
Box[T] field used before assignment
CLASS Tree { Box[Node] root METHOD init() { root = CREATE Node() } }
Constitution I.J
E3007memory:thread-capture-ref
Thread lambda cannot capture variables by reference
// Pass via CHANNEL instead of capturingConstitution I.L
E3008memory:thread-capture-volatile
Thread lambda cannot capture enclosing VOLATILE fields
// Use CHANNEL to communicate state changesConstitution I.L
E3009memory:current-thread-stored
currentThread cannot be assigned, stored, or passed
// Use currentThread->sleep() and currentThread->isCancelled() directlyConstitution I.L
E3010memory:moved-var
Variable accessed after being consumed
print(item.name) nodes->append(item)
Constitution I.I
E3011memory:field-shadow
local variable shadows a class field
Assign the field — `SELF.<field> = ...`Keep a new local — rename it to clear the shadow
Constitution I.E
E3012memory:redeclaration
Name already declared in this or an enclosing scope
Reassign without a type — `x = ...`Rename — you need two distinct variables
Constitution I.E
E3013memory:iterator-scope
iterator accessed outside its creating block
{ Iterator it := items->iterator()
it->next() }Constitution I.J
E3015memory:group-recursion
GROUP member type contains a GROUP-typed field
CLASS Branch { Box[Tree] child }
Constitution I.J
E3016memory:thread-lambda-ref
Thread lambda cannot capture a local variable by reference
// Send msg through a CHANNEL before starting the threadConstitution I.L
E3017memory:thread-expression-lambda
Thread argument must be a block-form lambda
Thread t = Thread(LAMBDA() { int32 result = compute() RETURN (result) })
Constitution I.L
E3018memory:thread-instance-method
Thread lambda cannot capture instance methods
// Extract data before thread, pass via CHANNELConstitution I.L
E3020memory:moved-in-return
Variable returned after being consumed
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
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
CLEANUP { closeResource() }Constitution I.I
E3023memory:multi-owner
Value assigned to two variables
MyClass a = CREATE MyClass() MyClass b := a // explicit deep copy
Constitution I.I
E3024memory:possibly-moved
variable possibly moved before this read
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
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
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
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
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
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
Foo a, Bar b := owningCall()
Constitution I.I
E3031memory:multi-assign-op-mismatch-reference
a multi-assign binding a REFERENCE-returning method must use `=@`
Foo a, Bar b =@ refCall()
Constitution I.I
E3032memory:strong-ref-reducible-to-borrow
SHARED MUTABLE REFERENCE field binds a SELF-reachable referent
Mon m // own it directly; no separate reference needed
Constitution I.I
E3033memory:strong-ref-cycle
Strong (refcounted) reference closes an ownership cycle
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
Own the values — `Foo[] items`
Constitution I.I
E3036memory:unsafe-access-outside-unsafe-block
FOREIGN_TYPE field accessed outside an UNSAFE block
UNSAFE { int32 fam = res.ai_family }
Constitution I.N
E3037memory:unsafe-handle-escapes-confinement
FOREIGN_TYPE handle may not be stored
CLASS S { opaque cached } // store opaque; rehydrate inside UNSAFE
Constitution I.N
E3038memory:borrow-into-owning-param
borrow cannot satisfy an owning parameter
items->append(arr[i]->clone()) // hand over an owned copyConstitution I.I
E3039reference:mode-flip-unsupported
reference mode-flip not supported in V1
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
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
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
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
IF arr->remove(0) THEN { sink->append($=) } // remove() moves it out
Constitution I.I
E3044memory:escaping-view
a view outlives the local it borrows
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
Create the receiver in this method, so the walk reads its classRebuild the dependency so its .evir is currentPass 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
Bind the referent to a named local and reference thatReport 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
// read the view BEFORE the move, or give the sink a copy and keep srcConstitution I.J
E3048memory:shared-ref-outlives-referent
a SHARED MUTABLE REFERENCE may outlive what it points at
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
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
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
print("done") RETURN 0
Constitution I.H
E4004control:break-outside-loop
BREAK used outside of a loop
METHOD run() { FOR i = 0 TO 10 { IF done { BREAK } } }
Constitution I.H
E4005control:continue-outside-loop
CONTINUE used outside of a loop
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
METHOD run() { FINALLY { cleanup() } RETURN 0 }
Constitution I.M
E4009control:throw-in-finally
PANIC is not allowed in FINALLY
FINALLY { cleanup() }Constitution I.M
E4010control:status-else
ELSE is invalid after STATUS IS
MATCH s { WHEN SUCCESS: { } WHEN FAILURE: { } }
Constitution I.M
E4011control:nested-loop-anon
Nested anonymous LOOP blocks are ambiguous
LOOP $_ { LOOP $item { } }
Constitution I.H
E4012control:match-void
MATCH target expression cannot be void
MATCH getStatus() { }Constitution I.H
E4013control:when-unreachable
Duplicate WHEN pattern
MATCH d { WHEN NORTH: { } WHEN SOUTH: { } }
Constitution I.H
E4014control:for-bounds
a FOR loop counts, so its bounds must be whole numbers
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
RECOVER (IOException e) { }Constitution I.M
E4017control:try-no-catch
TRY has no RECOVER and no FINALLY
TRY { risky() } RECOVER (IOException e) { handle(e) }
Constitution I.M
E4018control:status-without-check
STATUS value assigned but never checked
STATUS s = operation() IF s IS FAILURE { handleError(s) }
Constitution I.M
E4019control:when-guard-always-false
WHEN guard is always false (unreachable)
// Remove the unreachable WHEN clauseConstitution I.H
E4020control:match-on-non-value
MATCH target must produce a value
STATUS s = doWork() MATCH s { }
Constitution I.H
E4022control:throw-non-error
PANIC argument must extend Error
PANIC MyError("something went wrong")
Constitution I.M
E4023control:label-not-enclosing
that label does not enclose this jump
Use a boolean flag to exitExtract the inner loop to a METHOD that returns early
Constitution I.H
E4024control:loop-dot-field
dot-prefix iterator fields need LOOP $_
LOOP $_ IN items { int32 n = .index }
Constitution I.H
E4025control:for-step-direction
FOR STEP sign must match the direction
FOR i = 10 TO 0 STEP -1 { }
Constitution I.H
E4026control:super-non-subclass
SUPER needs a class that EXTENDS
// Remove SUPER() or add EXTENDS Parent to the class declarationConstitution I.K
E4027control:catch-non-error
RECOVER type is not an Error subclass
RECOVER (IOError e) { } // catch a class that EXTENDS Error
Constitution I.M
E4028type:recursive-value-type
value type contains itself, giving infinite size
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`
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
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
MATCH shape { WHEN Circle c: { } }
Constitution I.H
E4032control:loop-index-readonly
the LOOP index is read-only
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
LOOP row IN orders WITH INDEX i { }
Constitution I.H
E4034control:with-index-on-non-loop
WITH INDEX belongs to LOOP only
LOOP row IN orders WITH INDEX i { }
Constitution I.H
E4035control:continue-names-non-loop
CONTINUE needs a label that names a loop
LABEL attempt { BREAK attempt } // a block has no next iteration
Constitution I.H
E4036control:label-crosses-boundary
a labelled jump cannot cross this boundary
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
FINALLY { } // as with RETURN and PANIC
Constitution I.H
E4038control:label-name-collides
that label name is already used in this class
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
LABEL rows FOR x IN xs { }
Constitution I.H
E4090concurrency:thread-class-retired
Thread is retired — use CONCURRENT
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]
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]
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
// For point-to-point: channel->send(payload) // For broadcast: broker->publish(payload)
Constitution I.L
E4094concurrency:currentthread-retired
currentThread is retired — use currentTask
currentTask->sleep(100)Constitution I.L
E4095concurrency:delivery-mode-retired
DeliveryMode is retired — type-keyed dispatch replaces it
channel->send(payload) // Channel is point-to-point by typeConstitution I.L
E4100concurrency:scope-capture-non-owning
CONCURRENT body cannot borrow an outer variable
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
Move the state into the blockSend it through a `Channel`
Constitution I.L
E4102concurrency:scope-volatile-read
CONCURRENT body cannot read enclosing VOLATILE fields
// Publish via MessageBroker[StatusEvent] or read through a scoped Channel.Constitution I.L
E4103concurrency:task-not-user-constructible
`Task` cannot be constructed directly
CONCURRENT {
print(currentTask->name())
}Constitution I.L
E4104concurrency:future-not-user-constructible
`Future[T]` cannot be constructed directly
Future[int32] f := pool->submit(job, fn) int32 result := f->await()
Constitution I.L
E4105concurrency:parallel-outside-concurrent
PARALLEL is legal only inside CONCURRENT
CONCURRENT { PARALLEL { fetchData() } }
Constitution I.L
E4109concurrency:v2-detached
DETACHED CONCURRENT is reserved for V2
// Use CONCURRENT { ... } and let the scope guard manage lifetimeConstitution I.L
E4110concurrency:mutex-data-outside-synchronized
Mutex[T].data is reachable only inside a SYNCHRONIZED block
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
{ StringView w := b->view(0, 5) use(w) } STATUS s = b->append("x")Constitution I.J
E5005collections:mixed-types
Array literal contains mixed types
int32[] arr = [1, 2, 3]
Constitution I.J
E5006absence:empty-non-object
EMPTY applies only to an object handle
int32 count = 0 String name = ""
Constitution I.D
E5008collections:set-equatable
Set element type must implement Equatable
{String} items = EMPTY // String is EquatableConstitution I.J
E5009collections:for-in-non-iterable
FOR IN target is not iterable
FOR x IN myArray { }
Constitution I.H
E5013collections:for-in-non-array
FOR IN target is not an array
FOR x IN myArray { }
Constitution I.H
E5015collections:append-wrong-type
->append() argument type differs from the element
int32[] nums = EMPTY nums->append(5)
Constitution I.J
E5016collections:dict-remove-status
Dictionary->remove() returns (K, STATUS)
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
{int32} ids = EMPTY
ids->add(42)Constitution I.J
E5018collections:negative-index
array index is negative
int32 x = arr[arr.size() - 1]
Constitution I.J
E5021collections:sortedlist-comparable
SortedList element type must implement Comparable
Make the element type `IMPLEMENTS Comparable`Use `SortedList OF String`
Constitution I.J
E5022collections:for-in-string
FOR IN does not support String
FOR c IN myString->toCharArray() { }
Constitution I.H
E5023collections:dict-lookup-type
Dictionary->lookup() needs two LHS variables
STATUS s int32 val, s := map->lookup("key")
Constitution I.J
E5024reference:read-before-rebind
REFERENCE local read before being `=@`-rebound
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 `=`
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()
{String} a = EMPTY a->equals(b) // String is EquatableConstitution I.J
E6000–E6999
104 codes · mostly oop, reference, type
E6001oop:empty-interface
INTERFACE declares no methods
Add method declarations to the INTERFACEChange to GROUP — a classifier with no methods
Constitution I.K
E6002oop:empty-group
GROUP declares no member types
GROUP Shape { Circle, Square }
Constitution I.K
E6003oop:struct-object-field
STRUCT fields must be primitives or String
STRUCT Point { int32 x int32 y }
Constitution I.K
E6004oop:struct-method
STRUCT may not have methods
CLASS Point { int32 x METHOD move() { } }
Constitution I.K
E6005oop:struct-extends
STRUCT may not use EXTENDS or IMPLEMENTS
CLASS Point EXTENDS Shape { }
Constitution I.K
E6006oop:abstract-not-implemented
Abstract method not implemented in subclass
CLASS Dog EXTENDS Animal { METHOD speak() { print("woof") } }
Constitution I.K
E6007oop:final-class
Cannot extend a FINAL CLASS
Remove `FINAL` from the parentDo not extend it
Constitution I.K
E6008oop:final-method
Cannot override a FINAL METHOD
Remove `FINAL` from the parent methodDo not override it
Constitution I.K
E6009oop:private-field
Class field is private
Add an accessor method to the classDeclare the field `SHARED`
Constitution I.K
E6010oop:shared-field-mutation
SHARED field mutable only within its hierarchy
// Use SHARED VOLATILE to allow mutation from subclassesConstitution I.K
E6011oop:missing-super-init
subclass INIT must call SUPER() first
CLASS Child EXTENDS Parent { METHOD init() { SUPER() setup() } }
Constitution I.K
E6012oop:super-not-first
SUPER() must be the first INIT statement
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
CLASS Branch { Box[Tree] subtree }
Constitution I.J
E6016oop:struct-no-fields
STRUCT must declare at least one field
STRUCT Point { int32 x int32 y }
Constitution I.K
E6018oop:multiple-extends
CLASS may EXTENDS at most one parent
CLASS C EXTENDS A IMPLEMENTS B { } // or use interfaces
Constitution I.K
E6019oop:enum-extends
ENUM may use neither EXTENDS nor IMPLEMENTS
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
CLASS Dog IMPLEMENTS Runnable { METHOD run() { } }
Constitution I.K
E6021oop:interface-method-body
Interface method may not have a body
INTERFACE I { METHOD run() }
Constitution I.K
E6022oop:override-on-abstract
OVERRIDE not needed for an abstract method
METHOD speak() { } // no OVERRIDE needed for abstract implementations
Constitution I.K
E6023oop:interface-conflict
Interface inheritance conflict
// Resolve conflict by declaring a merged run() signature in CConstitution I.K
E6024oop:enum-non-exhaustive-method
enum method must MATCH all cases
Add a `WHEN` for the missing variantAdd a `DEFAULT` branch
Constitution I.K
E6025oop:field-group-type
a recursive GROUP-typed class field must use Box[T]
CLASS Node { Box[Tree] parent }
Constitution I.J
E6026oop:duplicate-field-name
field name conflicts with an inherited field
Rename the field in the childUse the inherited field directly
Constitution I.K
E6027oop:anonymous-class
Anonymous class declaration is not permitted
CLASS CustomShape EXTENDS Shape { METHOD draw() { } } CustomShape s := CREATE CustomShape()
Constitution I.K
E6028oop:inner-type
type declarations may not nest in CLASS
// Move Inner to its own file: Inner.evConstitution I.N
E6029oop:abstract-instantiate
cannot instantiate an ABSTRACT CLASS
// Instantiate a concrete subclass: Circle s := CREATE Circle()Constitution I.K
E6030oop:struct-visibility
STRUCT fields may not have visibility modifiers
STRUCT Point { int32 x }
Constitution I.K
E6031oop:struct-init
STRUCT may not declare an INIT method
STRUCT Point { int32 x int32 y } // INIT auto-generated
Constitution I.K
E6032oop:class-volatile-non-volatile
VOLATILE mutation requires a VOLATILE field
VOLATILE int32 count = 0 // declare VOLATILE to allow mutation by subclasses
Constitution I.K
E6033oop:super-twice
SUPER() may be called only once
CLASS Child EXTENDS Parent { METHOD init() { SUPER() x = 5 } }
Constitution I.K
E6034oop:module-private-access
Type is not exported from its module
// Add EXPORT to the type declaration in its module: EXPORT CLASS InternalHelperConstitution I.N
E6035oop:interface-extends-non-interface
INTERFACE may only EXTENDS another INTERFACE
INTERFACE Swimmer EXTENDS Moveable { } // Moveable is an INTERFACE
Constitution I.K
E6036oop:group-non-member-match
WHEN names a non-member of the GROUP
MATCH pet { WHEN Dog d: { } WHEN Cat c: { } }
Constitution I.K
E6038syntax:rebind-on-owned-lhs
=@ requires a REFERENCE or MUTABLE REFERENCE LHS
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
CLASS UTFCodec { PRIVATE ENUM State { BEGIN, ERROR } }
Constitution I.K
E6040type:move-from-reference
:= cannot move ownership out of a REFERENCE
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
// 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
// drop the check — primitives are always definedConstitution I.D
E6043type:is-valid-on-status
IS VALID does not apply to STATUS
STATUS s = service->call() IF s IS SUCCESS THEN { ... }
Constitution I.D
E6044type:is-valid-on-enum
IS VALID does not apply to enums
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
// drop the check — STRUCT values are always definedConstitution I.D
E6046reference:outlives-referent
a reference cannot outlive its referent
Narrow the reference to the inner scopeConstitution I.I
E6047reference:shared-xor-mutable
REFERENCE and MUTABLE REFERENCE cannot coexist on one source
// 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
// 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
// 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
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
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
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
IF foo() THEN { MyClass local := $= }
Constitution I.M
E6054reference:reference-chain
=@ source may not be another REFERENCE
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
swap(box, other) // distinct placesConstitution I.I
E6056oop:auto-clone-no-zero-arg-init
AUTO METHOD clone() requires a zero-arg INIT()
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
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
CLASS Foo IMPLEMENTS Cloneable { AUTO METHOD clone() { } } Foo a := other->clone()
Constitution I.K
E6059oop:cxx-reserved-outside-kernel
`_cxx*` types are kernel-internal
Mutex mConstitution II.L
E6060oop:cxx-reserved-inheritance
cannot EXTENDS / IMPLEMENTS a `_cxx*` type
CLASS MyLock { Mutex inner }
Constitution II.L
E6061pipe-result:reread
pipe success value consumed on first read
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
// declare UNION only in the ENVZN kernel; consumers use the value-class that wraps itConstitution II.L
E6063oop:foreign-type-deprecated
the FOREIGN_TYPE keyword is deprecated
// 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
IF Stdio->printline("hi") THEN { int32 written := $= }
Constitution I.M
E6065oop:method-not-on-type
method not on the receiver's static type
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
CLASS Foo IMPLEMENTS Cloneable { AUTO METHOD clone() { } }
Constitution I.K
E6067reference:loosen-mutable
cannot bind MUTABLE REFERENCE from an immutable receiver
REFERENCE int32 r =@ constHolder->slot()
Constitution I.I
E6068type:is-valid-on-always-present
IS VALID does not apply to a String
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
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
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
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
ABSTRACT CLASS Animal { ABSTRACT METHOD speak() RETURNS String }
Constitution I.K
E6075oop:abstract-generic
an ABSTRACT CLASS may not be a generic template
// abstract classes are non-generic in V1 — give it a concrete surfaceConstitution I.K
E6076oop:field-not-on-type
no such data field on the receiver's static type
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
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
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
// Shape s := CREATE Circle(5.0) // name the implementationConstitution I.J
E6080oop:group-member-unresolved
GROUP member names no known type
GROUP Shape { Circle, Square }
Constitution I.J
E6081oop:group-member-ineligible
GROUP member is not a classifiable type
GROUP Places { Path, File }
Constitution I.J
E6082oop:group-cycle
GROUP contains itself through its members
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
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
sv = source->view(0, n) // build a valid view instead
Constitution I.K
E6085oop:assign-array-surface
an array has no assignable member
a[a.length] = value // high-water-mark append; .length is read-onlyConstitution I.J
E6086oop:unknown-struct-field
struct has no field by that name
int32 w = spec.align // the declared field name
Constitution I.J
E6087reference:mutation-through-retained-borrow
cannot mutate a source a live object borrows
// 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
// 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
CLASS MyClass EXTENDS Shape { } // EXTENDS names a CLASS
Constitution I.K
E6090oop:interface-implements
an INTERFACE composes with EXTENDS — it implements nothing
INTERFACE Dictionary EXTENDS Cloneable, Equatable { ... }
Constitution I.K
E6091oop:interface-extends-conflict
two extended interfaces declare the same method incompatibly
Rename one method, or extend only the interface whose contract you meanConstitution I.K
E6092oop:parametric-interface-bare
a parametric type must be named with its type arguments
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
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
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
// read it inside Base or a subclass of Base, or expose a public METHODConstitution I.K
E6096oop:protected-method
a PROTECTED method is callable only from its class and subclasses
// call it inside Base or a subclass of Base, or make it publicConstitution I.K
E6097oop:param-mode-mismatch
a parameter's mode must match the slot it implements
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
Pass arguments that exactly one of the parent's own INITs acceptsAdd the INIT you meant to the parent class
Constitution I.K
E6099oop:implementation-narrows-access
an interface method's implementation must be public
CLASS Dog IMPLEMENTS Speaks { METHOD speak() RETURNS int64 { RETURN (1) } }
Constitution I.K
E6100serde:class-without-restore
reconstructed CLASS declares no RESTORE
CLASS Person { MODIFY METHOD RESTORE() RETURNS STATUS { RETURN (SUCCESS) } }
Constitution I.P
E6101serde:field-not-serializable
field type cannot be serialized
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
Hold the concrete type instead of the interfaceConstitution I.P
E6103serde:dictionary-key-not-text
Dictionary key has no reversible text form
Dictionary[String, int32] scores
Constitution I.P
E6104serde:reference-field
REFERENCE field is not serializable in V1
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
CLASS Dog EXTENDS Animal { OVERRIDE METHOD sound() RETURNS int64 { RETURN (1) } }
Constitution I.K
E6106serde:derived-misuse
DERIVED needs a RESTORE to compute it
Use a CLASS with a RESTORE, or drop DERIVED
Constitution I.P
E6107serde:collection-not-synthesized
only Array has a synthesized codec in V1
Use Array[T], or mark the field DERIVED
Constitution I.P
E6109pipe-result:unbound
`$=` is typeless: bind it before using it
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
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
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
METHOD run(int32 count, String... args) { }
Constitution I.K
E7003method:multiple-variadic
at most one variadic parameter per method
METHOD run(String... names) { }
Constitution I.K
E7004method:variadic-non-array
variadic parameter type must be an array
METHOD run(String... args) { }
Constitution I.K
E7005method:named-return-missing
named return not assigned on all paths
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
OVERRIDE METHOD run(int32 x) { }
Constitution I.K
E7008method:override-return-mismatch
override return type differs from the parent
OVERRIDE METHOD getValue() RETURNS (int32 n) { }
Constitution I.K
E7009method:ref-in-signature
'&' is not valid in method signatures
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
CLASS Dog IMPLEMENTS Animal { METHOD speak() { } }
Constitution I.K
E7011method:param-shadows-field
Method parameter name shadows a class field
CLASS C { int32 count METHOD add(int32 amount) { count += amount } }
Constitution I.E
E7012method:param-shadows-return
parameter name duplicates a named return
METHOD run(int32 input) RETURNS (int32 result) { }
Constitution I.E
E7015method:local-shadows-param
Local variable name shadows a method parameter
METHOD run(int32 count) { int32 localCount = 0 }
Constitution I.E
E7016method:consumed-after-append
Variable passed to ->append() is consumed
print(obj.name) items->append(obj)
Constitution I.I
E7017method:deprecated
This method is deprecated — see suggestion for replacement
// See DEPRECATED message on the method for guidanceConstitution I.K
E7018method:arg-count-mismatch
Method call has wrong number of arguments
result = obj->compute(1, 2)
Constitution I.K
E7021method:return-value-discarded
Return value discarded without '$?'
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
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
items->map(LAMBDA(x) { int32 y = x * 2 RETURN (y) })
Constitution I.F
E7024method:overload-ambiguous
ambiguous method call — multiple overloads match
Rename one overloadAdd a more specific type at the call site
Constitution I.K
E7025method:named-return-format
named returns use RETURN (varName) syntax
METHOD run() RETURNS (int32 code) { code = 0 RETURN (code) }
Constitution I.K
E7026method:lambda-thread-self
Thread lambda cannot reference SELF
// Extract data before thread, send via CHANNELConstitution I.L
E7027method:lambda-arity
lambda parameter count mismatch
items->map(LAMBDA x: x + 1)
Constitution I.F
E7028method:lambda-return-type
lambda return type mismatch
items->filter(LAMBDA x: x > 0)
Constitution I.F
E7029method:auto-clone-with-returns
AUTO clone() must not declare RETURNS
CLASS Foo IMPLEMENTS Cloneable { AUTO METHOD clone() { } }
Constitution I.K
E7030method:lambda-uninferable
lambda signature cannot be inferred
METHOD run(LAMBDA f) RETURNS int32 { RETURN (f(0)) }
Constitution I.F
E7031method:lambda-non-parameter
LAMBDA allowed only as parameter type
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
xs->map(LAMBDA (int32 v) { RETURN (v * 2) }) // yields int32
Constitution I.J
E7033method:lambda-param-mode
a LAMBDA parameter is always plain
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
String s = "hello world"
Constitution I.D
E8003string:escape
Invalid escape sequence in string literal
String s = "\n" // or "\\q" for literal backslash-q
Constitution I.D
E8004string:dollar-plain
'$' in a plain string is a literal character
String msg := ("Hello $1")->format(name)
Constitution I.D
E8005string:format-placeholder
->format() placeholder out of range ($1–$9)
// Split into multiple format calls for > 9 argsConstitution I.D
E8006string:char-overflow
Char literal value exceeds Unicode range (U+0000–U+10FFFF)
char c = '\U+1F600'Constitution I.D
E8008string:method-on-non-string
String method called on a non-String type
int32 len = myString->length()Constitution I.D
E8009string:multiline-delimiter
Multi-line string must use the /" delimiter
String s = /" line one line two "/
Constitution I.D
E8010string:format-type-mismatch
->format() argument type mismatches its placeholder
("Value: $1")->format(Convert->toString(myObject))
Constitution I.D
E8011string:format-no-placeholders
->format() args but no placeholders in string
("hello $1")->format(name)Constitution I.D
E8012convert:to-int-unchecked
Convert->toInt32 STATUS must be checked
STATUS s int32 n, s := Convert->toInt32(&str) IF s IS FAILURE { handle() }
Constitution I.D
E8013string:equality-operator
'==' compares String references — use ->equals()
bool same = strA->equals(strB)
Constitution I.D
E8014string:mutation
String cannot be modified in place
String newStr := str->replace(str->charAt(0), 'H')
Constitution I.D
E8015string:char-index-out-of-bounds
->charAt() index is statically out of bounds
char c = "hi"->charAt(1) // "hi" has indices 0 and 1
Constitution I.D
E8016string:char-vs-string
char expected — single-char string given
char c = 'a'
Constitution I.D
E8017string:format-missing-argument
placeholder has no matching argument
("$1 and $2")->format(arg1, arg2)Constitution I.D
E8018string:comparison-case
case-sensitive comparison — use ->equalsIgnoreCase()?
bool ok = input->equalsIgnoreCase("yes")Constitution I.D
E8019lex:numeric-literal-suffix
C/Rust numeric-literal suffixes are not valid
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
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
("$1 and $2")->format(a, b)Constitution I.D
E8022string:format-empty-spec
`:` after a placeholder opens a format spec, and none follows
("$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
("$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
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
Update the json `name` to match the filenameRename the json file to match the `name`
Constitution I.N
E9002module:dependency-not-found
dependency path not found
{ "path": "../existing_module" }Constitution I.N
E9003module:interfaces-ev-content
interfaces.ev holds only INTERFACE, GROUP, STRUCT
// Move CLASS MyHelper to MyHelper.evConstitution I.N
E9004module:structs-ev-content
structs.ev must contain only STRUCT declarations
// Move CLASS Config to Config.evConstitution I.N
E9005module:multiple-top-level
each .ev file must contain one CLASS
// Split into A.ev and B.evConstitution I.N
E9007module:group-wrong-file
GROUP declarations must go in interfaces.ev
// Move GROUP Status to interfaces.evConstitution I.N
E9008module:struct-shares-file
STRUCT must be alone or in structs.ev
// 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
// Add at least one .ev file with a CLASS or ENUM declarationConstitution I.N
E9010module:duplicate-symbol
duplicate type name in the module
// Rename one of themConstitution I.N
E9011module:circular-dependency
circular module dependency detected
// Introduce a shared third module C with no dependency on A or BConstitution I.N
E9012module:unknown-target
build target must be executable or shared_library
{ "target": "shared_library" }Constitution I.N
E9013module:manifest-malformed
<ModuleName>.json is missing a required field (name, version, target)
{ "name": "myapp", "version": "1.0.0", "target": "executable" }Constitution I.N
E9014module:dependencies-malformed
dependencies.json must be a JSON array
[{ "path": "../other" }]Constitution I.N
E9015module:no-entry-point
Executable module has no entry class
// Add start(String[] argv) RETURNS (int32 code) to one classConstitution I.N
E9016module:multiple-entry-points
more than one class declares start()
// Remove start() from all but one classConstitution I.N
E9017module:manifest-not-found
module manifest not found — expected <ModuleName>.json
// 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
// Ensure all transitive dependencies are present and their paths are correctConstitution I.N
E9019module:self-dependency
Module lists itself as a dependency
// Remove self-reference from dependencies.jsonConstitution I.N
E9020module:duplicate-dependency
Dependency listed more than once in dependencies.json
[{ "path": "../libA" }]Constitution I.N
E9021module:dependency-version
dependency version below the required minimum
Update the dependencyLower the version requirement
Constitution I.N
E9022module:empty-module
module's .ev files are all empty
// Add at least one CLASS, ENUM, STRUCT, INTERFACE, or GROUPConstitution I.N
E9023module:clang-not-found
clang++ not found on PATH
// macOS: xcode-select --install // Linux: apt-get install clang
Constitution I.N
E9024module:kernel-not-found
the kernel is not built or not staged
// build and stage it from the repo root: make installConstitution I.N
E9025module:ev-file-empty
source file declares no type
// Add: CLASS MyClass { METHOD run() { } }Constitution I.N
E9026module:undeclared-dependency
used type's module is not in dependencies.json
// Add: { "path": "../libCore" } to dependencies.jsonConstitution I.N
E9028module:clang-compile-error
clang++ rejected the generated C++
// Review error output above; check types, includes, and generated .cppConstitution I.N
E9031module:enum-wrong-file
ENUM declarations must go in enums.ev
// 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
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
Remove the entry pointChange the target to `executable`
Constitution I.N
E9036module:entrypoint-class-not-found
the entry point names a nonexistent class
Declare `CLASS Main IMPLEMENTS TaskStarter`Point `entrypoint.json` at an existing class
Constitution I.N
E9037module:entry-class-not-threadstarter
Entry class must IMPLEMENTS TaskStarter
// CLASS Main IMPLEMENTS TaskStarter { ... }Constitution I.N
E9039emit:unlowerable-construct
could not lower this construct to C++
// Rephrase/simplify the expression; report the case to the Envzn teamConstitution II.N
E9040module:kernel-type-shadow
module type may not shadow kernel names
// rename it: CLASS NetBox { ... }Constitution I.N
E9041module:reserved-envzn-name
module may not redeclare a reserved name
// rename it: CLASS AppSystem { ... }Constitution I.N
E9042module:evir-sidecar-invalid
dependency .evir sidecar is corrupt, stale, or written by another compiler
Rebuild the dependencyRemove the stale .evir and rebuild
Constitution I.N
E9043module:native-dep-not-found
native dependency not found — buildFlags reference a missing ${PREFIX}
// install the library, or set the ${...}_PREFIX variable to an existing installConstitution I.N
E9044module:multiple-manifests
module folder holds more than one manifest
// keep exactly one <ModuleName>.json; rename or remove the othersConstitution I.N
E9046module:library-has-entry-point
a shared_library may not define start(String[] argv)
// drop the parameter — METHOD start() — or make the module executableConstitution I.N
E9047module:name-not-identifier
module name is not a legal identifier
// { "name": "myApp" } // [A-Za-z][A-Za-z0-9_]*Constitution I.N
E9048module:name-reserved
module name shadows a reserved ENVZN name
// { "name": "AppMath" }Constitution I.N
E9049module:missing-module-declaration
every .ev file needs a MODULE declaration
// MODULE myLib // below the header comment, before any declarationConstitution I.N
E9050module:declaration-name-mismatch
MODULE declaration does not match the manifest name
// MODULE myLib // match the manifest exactly, case includedConstitution I.N
E9051module:banned-build-flag
manifest build flag can execute code at build time
// 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
// 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
// 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
// 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"
// "entrypoint": "app::Main::start"Constitution I.N
E9056module:entrypoint-method-not-start
the entry method must be start (the TaskStarter contract)
// "entrypoint": "app::Main::start"Constitution I.N
E9057module:entrypoint-module-mismatch
the entry point names a module other than this one
// 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
// "thread-stack-size": "8M"Constitution I.N
E9061evir:type-without-module
a type left the verifier with no module
// Rewrite the statement nearby (e.g. declare the slot's type: `int32 q2, $? := f()`) and report the printed node path to the Envzn teamConstitution II.N
E9062module:template-unpublished
a dependency's template was not published in its headers
// Rebuild Lib with this compiler (`epm build Lib`), then rebuild this moduleConstitution I.K.ix
E9063module:instantiation-filename-clash
two template instances would be written to the same file
// Rename one of the argument types so the two instances differ by more than caseConstitution I.K.ix
E9064module:c-catalog-missing
the module's C catalog is missing or out of date
Build the module with epm or make, which make the catalog before evc runsMake 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"
// "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
// "name": { "type": "String", "help": "who to greet" }Constitution I.N
E9067module:entrypoint-option-alias
an option "alias" is one unused letter, never "h"
// "name": { "type": "String", "alias": "n" }Constitution I.N
E9068module:entrypoint-option-rule
an option breaks a rule of the entrypoint block
// "shout": { "type": "boolean" } // a flag is never required or positionalConstitution I.N
E9069module:entry-class-has-init
the entry class declares no INIT; the runtime constructs it
// CLASS Main IMPLEMENTS TaskStarter { // METHOD start() RETURNS STATUS { ... }
Constitution I.N
E9070module:entry-option-field-kind
an options field must be blittable or String
// CLASS AppOptions IMPLEMENTS TaskStarterOptions { // String file
Constitution I.N
E9071module:entry-options-disagree
the entrypoint options and the options class disagree
// "options": { "name": { "type": "String" } }Constitution I.N
E9072emit:dispatch-incomplete
a lens dispatcher has no case for a class (compiler defect)
// Report the case to the Envzn team with the program that triggered itConstitution II.N
E10000–E10999
1 codes · mostly type
E10096type:implicit-conversion
implicit conversion may lose or reinterpret the value
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
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
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)
// 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
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
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()
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
// "entrypoint": "app::Main::start"Constitution I.N
W10000–W10999
65 codes · mostly style, lint, type
W10001style:empty-block
Empty method body
METHOD run() { /* TODO: implement */ }
Constitution I.K
W10002style:unused-variable
Local variable declared but never used
Remove the declarationUse the value
Constitution ENVZN_USER_GUIDE.md III.B
W10003style:dead-code
dead code after RETURN
print("done") RETURN 0
Constitution I.H
W10004style:missing-default
GROUP MATCH has no DEFAULT clause
MATCH status { WHEN SUCCESS: { } WHEN FAILURE: { } DEFAULT: { log("unhandled") } }
Constitution I.H
W10005style:unused-param
method parameter is never used
Remove the parameterUse it
Constitution I.K
W10006style:boolean-tautology
boolean expression is always true or false
bool ok = (x > threshold)
Constitution I.H
W10007style:large-param-list
method has more than 7 parameters
STRUCT RunConfig { int32 a String b ... } METHOD run(RunConfig cfg)
Constitution I.K
W10008style:very-long-method
method body exceeds 100 lines
// Extract logical steps into helper methodsConstitution I.K
W10009style:dict-lookup-unchecked
Dictionary->lookup() STATUS must be checked
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
// See DEPRECATED note for guidanceConstitution I.A
W10011style:complex-condition
complex conditional has more than 3 clauses
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
MATCH color { WHEN RED: { } WHEN GREEN: { } WHEN BLUE: { } }
Constitution I.H
W10013style:empty-catch
Empty RECOVER block silently swallows errors
RECOVER (FileNotFoundError e) { log(e.message) }
Constitution I.M
W10014style:return-value-ignored
return value silently discarded
$? := obj->parse(data) // explicit discard
Constitution I.M
W10015style:loop-nesting
loop nesting exceeds 3 levels
// Extract inner loops into helper METHODConstitution I.H
W10016style:magic-number
magic number in expression
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
ENUM ProcessMode { STRICT, LENIENT } METHOD process(ProcessMode mode) { }
Constitution I.K
W10018style:redundant-not
double negation (NOT NOT) is redundant
bool ok = isValid
Constitution I.H
W10019style:constant-in-loop
Constant expression in loop condition
Use a meaningful loop condition`BREAK` with a conditional inside
Constitution I.H
W10020style:single-element-collection
Collection initialized with a single element
int32 value = 42 // or keep as array if more elements expected
Constitution I.J
W10022style:method-length
method body exceeds 50 lines
METHOD process() { step1()
step2()
step3() }Constitution I.K
W10023style:nested-lambda
nested lambda — extract into a method
// Extract inner lambda to METHOD isMatch(x, y)Constitution I.F
W10024style:redundant-override
OVERRIDE body is identical to the parent
// Remove override; parent implementation is already usedConstitution I.K
W10025style:field-never-written
field set in INIT, never written again
// This field behaves like a constant; document that it is immutableConstitution I.K
W10026style:naming-convention
type names should use PascalCase
CLASS MyClass { }
Constitution I.D.ix
W10027style:method-naming
method name should be a camelCase verb
METHOD processData() { }Constitution ENVZN_USER_GUIDE.md III.B
W10028style:abbreviated-name
(retired) abbreviated-name style nag
int32 width, height, depth = compute()Constitution ENVZN_USER_GUIDE.md III.B
W10029style:missing-return-type
method has no RETURNS annotation
METHOD getCount() RETURNS (int32 n) { RETURN count }
Constitution I.K
W10030style:method-chaining
long method chain (4+ calls)
Intermediate mid = a->b()->c()
result = mid->d()->e()Constitution I.K
W10031style:resource-no-cleanup
resource-opening class has no CLEANUP block
CLASS FileWrapper { METHOD open() { handle = openFile() } CLEANUP { handle->close() } }
Constitution I.I
W10032style:redundant-type
type annotation restates the right-hand side
int32 x = 5
Constitution I.E
W10034style:file-name-convention
file name does not match declared type
// Rename file to MyClass.evConstitution I.N
W10035style:status-unchecked
STATUS assigned but never checked
STATUS s = doWork() IF s IS FAILURE { handleError() }
Constitution I.M
W10036style:cleanup-in-method
Resource cleanup done manually in a method
CLASS FileUser { File f CLEANUP { f->close() } }
Constitution I.I
W10037style:format-string-concat
String concatenates more than 3 literals
String msg := ("Part $1 of $2 complete")->format(part, total)
Constitution I.D
W10038style:interface-single-method
Interface declares only one method
// Consider if this interface will grow; single-method interfaces are sometimes fineConstitution I.K
W10039style:field-never-read
field written in INIT but never read
Remove the fieldUse it
Constitution I.K
W10040style:large-class
Class has more than 20 methods
// Extract sub-responsibilities: Parser, Emitter, Analyzer as separate classesConstitution I.K
W10041style:enum-raw-values-mixed
(retired) enum mixed-raw-values warning
ENUM Status { OK = 200, ERR = 500 }
Constitution I.K
W10042style:catch-and-rethrow
RECOVER immediately re-PANICs without modification
// Let the error propagate naturally; remove the TRY/RECOVERConstitution I.M
W10043style:group-single-member
GROUP has only one member type
// Use SuccessData directly; GROUP needs 2+ variants to be usefulConstitution I.K
W10044style:deep-inheritance
Inheritance chain is 4+ levels deep
Flatten via compositionUse interfaces
Constitution I.K
W10045style:lambda-complex-body
lambda block body exceeds 10 lines
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
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
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
remove the empty branch, or fill in the intended work
Constitution I.H
W10061lint:empty-block
empty ELSE body — the else branch does nothing
drop the empty ELSE, or fill in the intended workConstitution I.H
W10062lint:empty-block
empty loop body — the loop does nothing
fill in the loop body, or remove the loop
Constitution I.H
W10063lint:empty-block
empty MATCH arm — this case does nothing
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
handle the error (log / rethrow / recover), do not swallow it
Constitution I.M
W10065lint:empty-block
empty FINALLY body — the clause does nothing
remove the empty FINALLY, or add the cleanup it should runConstitution I.M
W10066lint:empty-block
empty anonymous block — { } does nothing
remove the empty block
Constitution I.H
W10067lint:empty-block
empty method body — the method does nothing
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)
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
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)
METHOD f(MUTABLE REFERENCE Widget w) RETURNS STATUS { w->resize(2) }
Constitution I.I
W10071lint:unused-dependency
declared module dependency is never referenced
remove the unused dependency from the manifest
Constitution ENVZN_USER_GUIDE.md III.B
W10085style:nested-control-flow
(retired) nested-IF-depth style nag
boolean ok = .allHold(a, b, c) IF ok THEN { }
Constitution I.H
W10086memory:reference-structural-advisory
REFERENCE binding satisfies neither structural safety condition
._ref =@ ._ownedChain.field // SELF-reachable
Constitution I.I
W10090format:argument-not-formattable
format() argument does not implement Formattable, so it may print [??]
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
// bind c in the block that uses it, so it releases at block exitConstitution I.I
W10093analyzer:when-is-undecidable-at-compile-time
`WHEN <value> IS <Type>` not compile-time decidable
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
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
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
int16 c = a + a // widen the receiver, or mask/convert the operands
Constitution I.F