Diagnostics

This page lists every message the compiler can report about a program, grouped by cause. Internal assertions and provenance lines (Called from here, Created here, Referenced here) are described, not listed. Each entry gives the message as printed, the condition that produces it, the change that resolves it, and the pages that define the rule behind it. A normal node diagnostic follows the location and the «token» being processed; parse errors, file errors, and command-line errors have their own shapes (see the Compiler page). Italic words in a message are placeholders; see Placeholders.

Placeholders

Placeholders are set in italics: name is a source name when the message prints one, or mplc's label for a named operand; schema is a schema as printStack prints it; requirement is the required kind as the message spells it, such as Cond, Number, or List or Tuple; number is a count or index; file and module are paths. operand is the compiler's object designation: Argument (label), First argument (label), Second argument (label), … counted from the lowest consumed input, where label is mplc's label for the operand and may differ from the Reference stack effect; mplc includes the parenthesized label only when it names the operand. It can also be Input «name» for a Code input; name is the label carried by the Code signature and is empty for this message when the signature has one input. It can also be Variadic tuple, Output value (condition), New value, or New item. hook is one of CALL, PRE, INIT, DIE, or ASSIGN. character, opener, and closer are the printed character or delimiter; parser-error is a parser payload; parameter is a command-line parameter; module-descriptor is the printed module binding; text is program-supplied Text; and assertion is the internal assertion text.

Some messages omit the parenthesized operand label. In signature and write messages, inputs, options, source-name, and struct-name are compiler operand designators, not names written in the program. item-name designates the selected item; item-caption is the printed Field «name» or Item number caption; and formatted-source-value, formatted-struct-value, and formatted-item-value are the corresponding printed values. branch is the TRUE or FALSE branch, label-list is the printed list of unused labels, stack-item-lines are the formatted objects left on the module data stack, line and column are source coordinates, and expected is the required option schema or type. The texts are those of mplc 260513.1; they are compiler specifics and may change, while the rules they enforce are documented on the linked pages.

Names and lookup

Message Cause and fix See
operand is invalid The exportFunction or importFunction builtin receives an empty Text as its function name. Supply a non-empty Text name before declaring or importing the function. Names, lookup, and overloads, exportFunction, importFunction
The name «name» is not defined in the module «module» The use builtin loads module but finds no public name name in that module. Correct the descriptor or define the requested name at module level and make it public. Modules, Names, lookup, and overloads, use
Argument (dict) does not have a field named «name» The .NAME member mention selects a Dict but finds neither a field nor a matching predicate named name. Use an existing public field or predicate, or add that field to the Dict. Selection and destinations, NameMember, Dict
The only predicate named «name» of the argument (dict) did not match The .NAME member mention finds exactly one predicate named name, and its PRE either returns known FALSE or fails processing gracefully. Make the guard accept the supplied inputs, repair an unintended failure inside PRE, or provide an older fallback candidate. Selection and destinations, NameMember, Cond
All number predicates named «name» of the argument (dict) did not match The .NAME member mention tries number predicates named name, and each is rejected because its PRE returns known FALSE or fails processing gracefully. Make a guard accept the supplied inputs, repair an unintended failure inside PRE, or provide an older fallback candidate. Selection and destinations, NameMember, Cond
Argument (dict) has a private field The .NAME or .@NAME member mention selects a private Dict field that is not visible from the selecting scope. Make the field public or perform the selection from the Dict that declares it. Selection and destinations, Names, lookup, and overloads, NameMember
Field «name» is a NIL Code A NAME or .NAME calling mention selects field name, which is a known NIL Code object. Assign a non-NIL Code before calling it; use a non-calling read such as .@NAME when inspecting the NIL Code is intended. Known and unknown values, NameMember, Code
Name was not found A NAME or !NAME mention finds no local, field, module name, or builtin with that name in the visible scopes. Check the spelling, load the defining module with use, or define the name before this mention. Names, lookup, and overloads, Name
The only predicate named «name» did not match A calling mention finds exactly one predicate named name, and its PRE either returns known FALSE or fails processing gracefully. Make the guard accept the supplied inputs, repair an unintended failure inside PRE, or provide an older fallback candidate. Names, lookup, and overloads, Name, Cond
All number predicates named «name» did not match A calling mention tries number predicates named name, and none has a PRE that returns TRUE. Make one predicate match or add a fallback. Names, lookup, and overloads, Name, Cond
Local «name» is a NIL Code The NAME mention resolves local name to a Code object whose known value is NIL. Assign or construct a non-NIL Code object before using that local. Names, lookup, and overloads, Name, Code
Argument (dict) does not have a field with the specified name The .@NAME read mention cannot find the requested field in its Dict argument. Correct the field name or add a public field with that name. Selection and destinations, NameReadMember, Dict
Name not found The @NAME read mention finds no local, field, module name, or builtin with the requested name. Check the spelling and define or import the name before reading it. Names, lookup, and overloads, NameRead
Operation is not allowed for built-ins, try [name] @NAME is used with a builtin name, but builtins are operations rather than readable objects. Invoke the builtin directly, or put it in a Block such as [NAME] when a callable object is needed. Names, lookup, and overloads, NameRead, Block and Code
Operation is not allowed for built-ins !NAME selects a builtin name as its destination, but builtins cannot be written. Use a user-defined local or field as the destination. Selection and destinations, NameWrite, Names, lookup, and overloads
Name stack underflow The ; Variable node has no pending label to bind to the top object. Put a label such as x: before ;, or remove the stray terminator. Data stack and name stack, Variable
Predicate did not return a known Cond A predicate finishes without a known Cond object as its result; it may leave no result, a different schema, or an unknown value. Make the predicate leave a known Cond on its output stack. PRE result, Known and unknown values, Cond
Name label «name» was not used Scope processing ends with one label that no ; Variable node consumed. Remove the label or bind an object through it before the scope closes. Data stack and name stack, Variable, Names, lookup, and overloads
Name labels label-list were not used Scope processing ends with several labels that no ; Variable nodes consumed. Remove the unused labels or consume each with its intended object before leaving the scope. Data stack and name stack, Variable, Names, lookup, and overloads
First argument (dict) does not have a field named «name» callField selects its first Dict argument and finds neither a field nor a matching predicate named name. Correct the field name or add a public callable field or predicate to the Dict schema. callField, Selection and destinations, Dict
The only predicate named «name» of the First argument (dict) did not match callField finds exactly one predicate named name in its first Dict argument, and its PRE either returns known FALSE or fails processing gracefully. Make the guard accept the supplied inputs, repair an unintended failure inside PRE, or provide an older fallback candidate. callField, Selection and destinations, Cond
All number predicates named «name» of the First argument (dict) did not match callField tries number predicates named name in its first Dict argument, and each is rejected because its PRE returns known FALSE or fails processing gracefully. Make a guard accept the supplied inputs, repair an unintended failure inside PRE, or provide an older fallback candidate. callField, Selection and destinations, Cond

Stack shape and function outputs

Message Cause and fix See
Stack sizes are different if processes an unknown condition, and its true and false branches leave different numbers of objects. Make both branches consume and produce the same number of objects. Stacks, if
Output value count is inconsistent loop processes a runtime-repeated body that leaves a different number of objects from the number it receives, apart from the final condition. Return the carried objects followed by exactly one Cond. Stacks, loop, Cond
Output value (condition) is not Cond loop leaves a top output object whose schema is not Cond, including during a static iteration. Leave a Cond as the body's final output. Stacks, loop, Cond
Block does not consume all input values A function Block leaves one or more declared input objects unconsumed. Consume every declared input in the Block. Block code, Call boundary, exportFunction
Function returned redundant values A Code body declares no output but leaves objects, or declares an output but leaves more than one object. Consume the extra objects. To return several results, pack them into one Struct and declare that Struct as the output. Declared output, Call boundary
Function did not return a value A function body with a non-empty output signature leaves no object for its declared output. Produce one object matching the declared output. Declared output, Call boundary
Function returned reference of unexpected schema A function returns a Ref with the wrong target schema: a Ref output requires the target schema named by that Ref signature, while a non-Ref output requires the declared output schema itself. Return a Ref with the appropriate target schema or change the output declaration. References, Call boundary, Ref
Function returned reference that is not mutable A function declares a mutable Ref output but returns an immutable Ref view. Return a mutable Ref view or declare an immutable reference output. References, Views, Call boundary
Function returned reference that targets a local value A function with a Ref output returns a known Ref targeting an object owned by its own local scope. Return a Ref to storage that outlives the function, or, to return the local object itself, declare a non-Ref output of that object’s schema. References, Call boundary, Objects and values
Function returned reference that is not targeting a local value A function declared to return a non-Ref object returns a Ref whose target is unknown, NIL, or outside that function's scope. Return an object of the declared schema, or declare a permitted Ref output. References, Call boundary
Output reference points to a part of a local value At a Block boundary, or for a non-empty, non-Ref Code output, a Ref targets a sub-item of a local owned by the ending scope. Return the whole object or copy the sub-item into an independent output. References, Objects and values, Call boundary
Function returned value of unexpected schema A function returns a non-Ref object whose schema differs from the declared output schema. Return an object with the declared schema or change the output declaration. Declared output, Schema kinds
The module has left items on the stack
----
stack-item-lines
----
Module processing ends with one or more objects still on the data stack. Consume or use every top-level object before the module ends. Stacks, Modules, Compiler output
[INIT] changed the stack (expected no effect) Constructing an object calls INIT, which changes the data-stack size instead of leaving it unchanged. Make INIT leave the caller's data stack unchanged: consume any temporaries created inside INIT, not pre-existing caller objects. Structs, manuallyInitVariable
[DIE] changed the stack (expected no effect) Destroying an object calls DIE, which changes the data-stack size instead of leaving it unchanged. Make DIE leave the caller's data stack unchanged: consume any temporaries created inside DIE, not pre-existing caller objects. Structs, manuallyDestroyVariable
Stack output #number of the branch branch is of different schema
Actual:   schema
Expected: schema
if processes an unknown condition, and corresponding branch objects at one stack position have different schemas. Make both branches produce the same schema at every stack position. Stacks, if, Schema kinds
Stack output #number is of different schema
Actual:   schema
Expected: schema
loop repeats a body at runtime whose carried object at one stack position has a different schema from the corresponding input object. Keep the number and schemas of carried objects unchanged during runtime repetition. Stacks, loop, Schema kinds
operand is not on the stack A construct needs an object that is absent: operand may designate a builtin argument, a Code input, the variadic tuple, a loop condition, New value, or New item. Push or produce the required object before invoking the construct. Stacks, array
operand is not requirement A construct receives an object whose schema does not meet requirement. The operand designator may name a builtin argument, Code input, variadic tuple, loop output, New value, or New item. Supply an object with the required schema. Stacks, Schema kinds, fieldIndex
operand is not requirement known at compile time A construct requires an object whose value is known at compile time and whose schema meets requirement. The operand designator may name a builtin argument, Code input, variadic tuple, loop output, New value, or New item. Supply a compile-time-known object of the required schema, or choose an operation that accepts an unknown value. Known and unknown values, Stacks, fieldIndex
Stack underflow A source-level operation would need an empty data stack to reach an unchecked access, but the checked builtin path reports the missing operand first. Not reachable from source code in this compiler version; report it as a compiler defect. Stacks, Diagnostics and status

Schemas and writes

Message Cause and fix See
operand is Code alignment, storageSize, newVarOfTheSameType, or set targets an operand whose dereferenced object has schema Code. Pass a non-Code target or choose an operation that permits Code. Code, alignment, set
operand is Text alignment, storageSize, newVarOfTheSameType, or set targets an operand whose dereferenced object has schema Text. Pass a non-Text target or choose an operation that permits Text. Text, alignment, set
operand is of different schema A same-schema operation such as and, +, =, or set receives two objects with different schemas. Supply matching schemas before applying the operation. Objects and values, Schema kinds, and
operand is negative array receives a known negative Int32 object as its count. Use zero or a positive count, or choose a path that does not require a known count. array, Int32, Known and unknown values
operand is empty callField receives an empty dictionary schema rather than a Dict with fields. Pass a non-empty Dict whose schema contains the requested field or predicate. callField, Dict, Structs
operand is out of bounds A field-selection or introspection operation receives a known integer ordinal outside the target Struct's field range. Use an ordinal from zero through the final field, or use a valid dynamic operation on a uniform Struct. Structs, fieldName, fieldRead
operand is not uniform @, !, fieldRead, or fieldWrite uses an unknown ordinal with a non-uniform Struct. Make the ordinal known, or use a uniform Struct for that unknown-ordinal operation. Structs, Known and unknown values, fieldRead, fieldWrite
operand was not found in the schema fieldIndex finds no matching Dict field, or a List/Tuple is empty or was given a non-empty name. Use an existing Dict field name; for a non-empty List or Tuple, use "" to select its final item. Selection, fieldIndex, Struct
operand is not mutable A write operation such as !, fieldWrite, or set targets an object through an immutable view. Use a mutable Ref/view for the destination, or remove the write. Views, fieldWrite, set
operand.SCHEMA_NAME is NIL schemaName finds a static SCHEMA_NAME field of schema Text whose value is NIL. Declare it with a known, non-NIL Text object, for example SCHEMA_NAME: "Widget" virtual;, or remove the field to use the formatted-schema fallback. schemaName, Dict, Text
Second argument (dict) is not a reference .!NAME receives a Dict object instead of a Ref to the Dict as its second object. Pass a Ref view of the Dict, such as a mutable selection, before the member write. NameWriteMember, Views, Ref
Second argument (dict) is not mutable .!NAME receives an immutable Ref to its second Dict object. Use a mutable Ref/view for that Dict, or do not perform the member write. NameWriteMember, Views, Ref
Second argument (dict) does not have a field with the specified name .!NAME cannot find the selected source-text name as a field in its second Dict object. Correct the member name or add that field to the Dict schema. NameWriteMember, Selection, Dict
Second argument (dict) has a private field .!NAME selects a private field in its second Dict object, and that field is not visible from the selecting scope. Make the field public or perform the write from the Dict that declares it. NameWriteMember, Names, lookup, and overloads, Selection
Dict is not a reference An !NAME field write selects a Dict that is not held through a Ref; this can occur in a method of a Meta Dict. Remove an unnecessary write, or, if mutable storage is intended, use a non-Meta Dict reached through a mutable Ref. NameWrite, Views, Ref
Dict is not mutable !NAME selects a Dict through an immutable Ref. Use a mutable Dict view for the write, or choose another mutable destination. NameWrite, Views, Dict
Argument (source) is of unexpected schema !NAME has a Block source, but its destination local is neither Block nor Code. Assign an object with the destination schema, or use a Code destination with the intended signature; a different Block schema is reported as Type mismatch. NameWrite, Block and Code, Schema kinds
Argument (source) is an immutable reference while a mutable reference expected !NAME assigns an immutable Ref source to a destination whose Ref view is mutable. Pass a mutable source view or declare the destination to accept an immutable Ref. NameWrite, Views, Ref
Argument (source) is a reference while not a reference expected !NAME assigns a Ref source to a non-Ref destination. Use new to supply an object instead of its Ref (for example, x new !y); an immutable view copies and a mutable view moves. Alternatively, change the destination to a Ref. NameWrite, Views, Ref
Input «name» is of different schema
Actual:   schema
Expected: schema
A call supplies an input object whose schema differs from the corresponding Code signature input; the diagnostic shows the actual and expected schemas. Supply an object with the declared input schema or change the Code signature. Call boundary, call, Schema kinds
Type mismatch, source: schema, destination: schema !NAME or fieldWrite compares a source object with its destination and their schemas differ. Supply an object with the destination schema or change the destination declaration. NameWrite, Objects and values, Schema kinds
source-name is incompatible with target's item-name
> source-name: formatted-source-value
> struct-name: formatted-struct-value
> item-caption: formatted-item-value
A named Dict-field write (!NAME or .!NAME), or a fixed-key write (! or fieldWrite), supplies a source object incompatible with the selected fixed-key Struct item. The detail lines repeat the source, Struct, and selected item with the printed caption Field «name» or Item number. Supply a source with the required schema, reference kind, and view. NameWrite, NameWriteMember, Objects and values, !, fieldWrite
source-name is an immutable reference while target's item-name is a mutable reference
> source-name: formatted-source-value
> struct-name: formatted-struct-value
> item-caption: formatted-item-value
A named Dict-field write (!NAME or .!NAME), or a fixed-key write (! or fieldWrite), supplies an immutable Ref for a mutable-reference fixed item. The detail lines repeat the source, Struct, and selected item with the printed caption Field «name» or Item number. Pass a mutable Ref view or make the target item immutable. NameWrite, NameWriteMember, Views, !, fieldWrite
source-name is a reference while target's item-name is not a reference
> source-name: formatted-source-value
> struct-name: formatted-struct-value
> item-caption: formatted-item-value
A named Dict-field write (!NAME or .!NAME), or a fixed-key write (! or fieldWrite), supplies a Ref for a non-Ref fixed item. The detail lines repeat the source, Struct, and selected item with the printed caption Field «name» or Item number. Write the referenced object itself or change the target item to a Ref. NameWrite, NameWriteMember, Views, !, fieldWrite
source-name is incompatible with target
> source-name: formatted-source-value
> struct-name: formatted-struct-value
! or fieldWrite uses a dynamic key on a uniform Struct and supplies an incompatible source object; the message also shows formatted source and Struct data. Use a source compatible with the uniform field schema. Structs, !, fieldWrite
source-name is an immutable reference while target contains mutable references
> source-name: formatted-source-value
> struct-name: formatted-struct-value
! or fieldWrite uses a dynamic key on a uniform Struct whose fields are mutable Refs, but the source is an immutable Ref; the message also shows formatted source and Struct data. Pass a mutable Ref view or use a target whose uniform fields are immutable. Structs, Views, !
source-name is a reference while target contains not references
> source-name: formatted-source-value
> struct-name: formatted-struct-value
! or fieldWrite uses a dynamic key on a uniform Struct with non-Ref fields, but the source is a Ref; the message also shows formatted source and Struct data. Write the referenced object itself or make the uniform fields Refs. Structs, Views, !

References, locals and lifetime

Message Cause and fix See
operand is NIL An operation that requires Text—textSize, textSplit, &, =, <, >, has, def, fieldIndex, use, attribute, call, ucall, callField, exportFunction, importFunction, importVariable, printCompilerMessage, or raiseStaticError—receives a Text object whose known value is NIL. Supply a non-NIL Text. A NIL Ref is reported as operand is referenced by NIL; a NIL Code as operand is a NIL Code. Known and unknown values, textSize, call
operand is a NIL Code call receives a Code object whose known value is NIL. Assign a Block or function to the Code object before calling it, or do not call a signature-only codeRef object. Block and Code, call
operand is not Code, Meta, Ref, or Text const or unconst receives an object whose schema is not Code, Meta, Ref, or Text. Apply the conversion to a permitted object; for an In-place object, first use a Ref view, or remove the conversion. Locations, references, and views, const
Captured Dict is outside of the current function A Code Block refers to a solid field of a Dict defined outside the current function. Make the field static or Meta, pass the data as a function input, or keep the access in the enclosing Block. Block and Code, Structs
Local variable has gone out of scope A name use would refer to a local after its scope ended, but normal scope cleanup removes that name before this condition can be observed. Not reachable from source code in this compiler version; report it as a compiler defect. Call boundary and inline processing, Names, lookup, and overloads
Captured local variable is outside of the current function A Code Block refers to a non-static local from an enclosing function. Pass the runtime data as a Code input, or use a Meta or static local instead of capturing a solid local. Block and Code, Call boundary and inline processing
Input «name» is an immutable reference while a mutable reference expected call supplies an immutable Ref to a Code input that requires a mutable Ref. The diagnostic identifies that input from the Code signature: a signature with one input prints an empty label as Input «», while a signature with two or more inputs prints the input's signature label. Pass a mutable view such as @NAME, or declare the input to accept an immutable Ref. Locations, references, and views, Call boundary and inline processing, call
Input «name» is a managed reference call supplies a Ref to a Managed target where the Code input expects a value object. Pass a value object, such as one produced by new, or declare the Code input as a Ref. Call boundary and inline processing, Structs, call
operand is not allowed to copy because it is Meta Managed A copy operation such as new, set, or an applicable array path would copy a Struct whose schema is both Meta and Managed, including when it is nested in another Struct. Do not copy that Meta Managed object, or remove managed lifetime behavior if it should be pure Meta. Meta objects, Structs, new
operand is a value with DIE field but without ASSIGN field A copy operation such as new, set, or an applicable array path reaches a managed Struct with a DIE field but no ASSIGN field. Add a compatible ASSIGN field, or avoid copying the object. Structs, Locations, references, and views, new
operand is in invalid location set, new, or a related copy/move operation reaches a known source or destination Ref whose target location is invalid. Initialize the storage and pass a valid Ref rather than NIL or an invalid location. Locations, references, and views, set, Known and unknown values
A local value has leaked to an external reference A Block assigns a Ref to one of its own local objects into a captured reference that survives the Block. Keep the target in the enclosing scope, or move or return the owning object before binding a reference to it. Call boundary and inline processing, Locations, references, and views, Stable and unstable objects
Output reference points to a managed object that has already been elevated to the parent scope A Block output would retain a second Ref to a Managed object after that whole object has already moved to the parent scope. Not reachable from source code in this compiler version; report it as a compiler defect. Call boundary and inline processing, Structs, Locations, references, and views
Item #number refers to a local value A Struct's unnamed item is a Ref to an object owned by the ending local scope. Return or copy the item object, or return the whole owning object instead of retaining a reference into that scope. Call boundary and inline processing, Structs, Locations, references, and views
Field «name» refers to a local value A Struct field named name is a Ref to an object owned by the ending local scope. Return or copy the field object, or return the whole owning object instead of retaining a reference into that scope. Call boundary and inline processing, Structs, Locations, references, and views
operand is not allowed to move because it is Meta Managed A move operation such as new, set, or an applicable array path would move a Struct whose schema is both Meta and Managed. Do not move that object; remove managed lifetime behavior from the Meta schema or keep the object in place. Meta objects, Structs, new
operand is referenced by NIL An operation dereferences a known NIL Ref; arithmetic and field reads are examples. Initialize or bind the Ref to a target, or test for NIL before the operation. Locations, references, and views, Known and unknown values, new
operand is not Block, Meta, or Ref new receives an In-place or other non-Meta object instead of a Block, Meta object, or Ref. Give it a Block, Meta object, or Ref view, or use an operation suited to the source schema. Locations, references, and views, Block and Code, new
operand is a value with DIE field but without INIT field Constructing a managed Struct finds a DIE field but no INIT field. Add an INIT field with no data-stack effect, or remove DIE and the managed lifetime. Structs, new

Known values and compile-time limits

Message Cause and fix See
operand is Meta storageAddress, addressToReference, or importVariable requires runtime storage but receives a Meta object; @, !, fieldRead, or fieldWrite uses an unknown ordinal on a Meta Struct; or a Code signature declares a non-empty Meta output. Supply a non-Meta runtime object, use a known ordinal, or declare a non-Meta output. Meta, Objects and values, storageAddress, exportFunction
operand is Text not known at compile time call or ucall receives Text whose value is unknown, so the source to process cannot be selected at compile time. Make the Text object's value known or use a Block. Known and unknown values, call, ucall
Static loop count limit (number) reached loop statically unrolls more iterations than the configured limit (256 by default). Make the loop terminate sooner, make it dynamic, or raise the compiler limit. loop, Compiler options, Known and unknown values
Static loop is infinite: iteration #number is the same as iteration #number Static loop processing revisits the same compiled state at two iterations, so the known loop state makes no progress. Change the body's known inputs or state, or use a dynamic loop with a runtime termination condition. loop, Known and unknown values, Stacks
operand is zero / or mod receives a known zero divisor. Supply or prove a nonzero divisor before the compile-time operation. Known and unknown values, /, mod
operand divided by -1 overflows / or mod evaluates the minimum signed integer divided by -1 at compile time. Avoid that pair, widen the computation, or guard the divisor or operand before the operation. Known and unknown values, /, mod
Call depth limit (number) reached A Block that calls itself by name, or nested compile-time processing through ucall or uif, can reach the configured call-depth limit (1024 by default). A finite recursion with a known terminating condition can compile; unbounded or runtime-dependent recursion cannot. Write such a recursive function as a module-level Code (f: {n: Int32;} Int32 {} codeRef; then [...] !f; see Block and Code), replace the recursion with loop, or raise the limit with -callDepthLimit. Call boundary, ucall, Compiler options
Intx constant overflow The Number node receives an Intx literal outside the selected target-width signed range. Use a literal within the target range or compile for a width that can represent it. Intx, Compiler options
Natx constant overflow The Number node receives a Natx literal outside the selected target-width unsigned range. Use a literal within the target range or compile for a width that can represent it. Natx, Compiler options
operand is not suitable for a static variable because it is Managed A virtual declaration marks a candidate object static even though its schema is Managed. Do not make that object static, or remove its managed lifetime behavior. Structs, Known and unknown values, virtual
operand is not suitable for a static variable because it is not completely known A virtual declaration marks a candidate object static even though its value or a nested object's value is not completely known at compile time. Use known static data, or keep the variable non-static. Known and unknown values, virtual, Views
operand is not suitable for a static variable because it contains non-NIL code reference A virtual declaration would require a known non-NIL Code object, but ordinary source constructs provide either a NIL Code object or a non-completely-known Code object. Not reachable from source code in this compiler version; report it as a compiler defect. Known and unknown values, Block and Code, virtual
operand is not suitable for a static variable because it contains non-NIL references A virtual declaration marks a candidate object containing a non-NIL Ref. Use a NIL Ref for static data, store the referenced object itself, or keep the reference non-static. Known and unknown values, Views, virtual
struct-name's item-name is static
> source-name: formatted-source-value
> struct-name: formatted-struct-value
> item-caption: formatted-item-value
A named Dict-field write (!NAME or .!NAME), or a fixed-key write (! or fieldWrite), targets a static Struct item with a fixed key. The detail lines repeat the source, Struct, and selected item with the printed caption Field «name» or Item number. Write to a non-static item or change the schema instead of assigning to static data. NameWrite, NameWriteMember, Known and unknown values, !, fieldWrite
operand is not known at compile time < or > compares Text objects whose value is not known at compile time. Make both Text values known, or load algorithm and use its runtime lexicographic < or > overload. Known and unknown values, <, >

Declarations, specifiers and signatures

Message Cause and fix See
Attribute specifier is duplicate attribute is applied while the current scope already has a pending text attribute. Apply one attribute before the text it decorates, and do not set another until that text consumes the pending attribute. Processing, attribute
Can only be called at the module level exportFunction or importFunction is invoked below module level. Move the declaration to module scope. Modules, exportFunction, importFunction
Static specifier is not valid here A declaration follows a pending static specifier set by virtual, but exportFunction, importFunction, or importVariable does not accept it. Remove virtual or apply it only to a declaration that accepts it. Names, lookup, and overloads, exportFunction, importFunction, importVariable
Function «name» is already declared with a different signature exportFunction or importFunction declares a name whose existing declaration has a different computed signature. Use one signature for that name or choose a different name. Names, lookup, and overloads, Call boundary, exportFunction, importFunction
Function «name» is already defined exportFunction declares a function name and signature that already has a definition. Define the function once or choose a different name. Names, lookup, and overloads, exportFunction
Specifier is duplicate overload, private, or virtual is used while the same pending specifier is already set. Use each specifier once before the declaration that consumes it. Names, lookup, and overloads, overload, private, virtual
operand support is not implemented ucall receives a callable object with a schema other than Block or Text. Use ucall with a Block or known Text; use call for a callable Dict with a CALL field or a non-NIL Code. Call boundary, ucall, call
Variadic tuple is Meta A call to a variadic Code object receives a non-empty List or Tuple whose schema is Meta. Supply non-Meta variadic items, or () when no additional arguments are intended. Meta, Call boundary, codeRef
Variadic tuple has item that is Meta A call to a variadic Code object receives a List or Tuple whose item schema is Meta. Ensure every variadic item has a non-Meta schema. Meta, Call boundary, codeRef
Overload specifier was not used Scope processing ends with a pending overload specifier that no declaration consumed. Put overload immediately before the name declaration it should mark. Names, lookup, and overloads, overload
Private specifier was not used Scope processing ends with a pending private specifier that no declaration consumed. Put private before the field or name declaration it should mark. Names, lookup, and overloads, private
Virtual specifier was not used Scope processing ends with a pending virtual specifier that no declaration consumed. Put virtual before the declaration it should make static. Names, lookup, and overloads, virtual
Attribute specifier was not used The scope ends without creating a known, non-NIL Text object to consume its pending attribute. Create such a Text in the same scope after attribute, typically with a Text literal; merely reading an existing Text local does not consume it. Processing, attribute
inputs has input «name» that is static A Code-signature declaration receives an input Dict with a static field name. Remove virtual from the input field declaration. Call boundary, Names, lookup, and overloads, exportFunction
inputs has input «name» that is Meta codeRef, exportFunction, or importFunction receives an input Dict with a Meta field name. Declare that input with a non-Meta schema. Meta, Call boundary, exportFunction
Warning: Input «name» is a Text Nonfatal: a Code signature has a Text input; compilation continues. Verify that Text is intentional, or change the descriptor and all callers to the non-Text representation the interface requires. Signature inputs, Known and unknown values
Warning: Second argument (output) is a Text Nonfatal: a Code signature has a Text result; compilation continues. Verify that Text is intentional, or change the descriptor and all callers to the non-Text representation the interface requires. Signature descriptors, Known and unknown values
options has option «name» that is not expected A codeRef, exportFunction, or importFunction declaration gives supported option name the wrong schema. Use the required schema: Text for convention and Cond for variadic. Options, exportFunction
options has option «name» that is static A Code-signature declaration marks supported option name static. Remove virtual from the option field declaration. Options, virtual
options has option «name» that is not known A Code-signature declaration gives a supported option whose value is not known at compile time. Supply a known option value. Options, Known and unknown values
options has option «name» that is NIL A Code-signature declaration gives a Text option whose known value is NIL. Supply a non-NIL Text option. Options, Text
options has option «name» that is not supported A Code-signature declaration includes an option field other than convention or variadic. Remove that field or use one of those supported option names. Options, exportFunction
hook field is not a Block A reserved Dict hook is not a Block: CALL during invocation, PRE during guarded lookup, INIT during construction, DIE during destruction, or ASSIGN during copying. Define the indicated hook as a Block with its required stack contract. Selection, Dict, Structs, Names, lookup, and overloads, call
Overload specifier is not valid here importVariable is preceded by an overload specifier, which that declaration does not accept. Remove overload from the import-variable declaration. Names, lookup, and overloads, importVariable

Modules, files and parsing

Message Cause and fix See
Argument (module descriptor) contains an invalid symbol name «» The use builtin receives a module descriptor that ends with a dot, so its symbol component is empty. Remove the trailing dot or add a symbol name after it. Modules, use, Source and module paths
Argument (module descriptor) contains an invalid module name «» After removing an optional .symbol suffix, the module path in the use descriptor is empty, as in "" or ".value". Supply the module path before the optional symbol suffix, for example "p.value". Modules, use, Source and module paths
Circular dependency for file «file» The use builtin requests file while that module is already loading through the same dependency chain. Break the cycle by moving shared definitions to a third module or changing the use direction. Modules, Source and module paths, use
File «file» was not initially loaded at the global level The use builtin first requests file from a nested compile-time scope instead of module level. Move the first use to module level and pass the resulting name or object into the nested Block. Modules, Call boundary and inline processing, use
Unable to load file «file» mplc cannot load a primary source file or a module requested by use. Check the filename or descriptor, search directories, and read access. Source and module paths, Modules, use
«module-descriptor» has never been used Nonfatal: with -detectRedundantUses, mplc did not observe use of the imported binding. Remove the import only after reviewing whether it is needed; this note alone does not make compilation fail. Compiler options, Modules
Unable to save file «file» mplc could not save LLVM IR at the -o path. Create the parent directory, check write access, or choose a writable file path; an existing writable file with different contents is overwritten. Output, Diagnostics and status

Parse errors

Each row below is the parser payload that follows its source coordinates; the shared Parse error line is retained for lookup.

Message Cause and fix See
file(line,column): parser-error
Parse error
MPL syntax is invalid in a source or module file, in Text processed by call or ucall, or in a -D definition. For a file, edit the reported file; for call or ucall, inspect the supplied Text at its own reported coordinates (the path may be <BASE>), and for generated <BASE> source, correct the command-line definition. Source and module paths, Text, Diagnostics and status
Module has invalid UTF-8 byte sequence The source contains a byte sequence that the UTF-8 decoder rejects. Save the source as valid UTF-8 or replace the invalid byte sequence. Diagnostics and status
Text literal is unterminated, expected hex digit A Text hex escape ends before the next required hex digit. Complete the escaped UTF-8 byte sequence and close the literal. Text
Text literal has non-hex character «character» in hex escape A Text hex escape contains a character outside 0–9 and A–F. Replace it with the required hexadecimal digit. Text
Text literal is unterminated, expected escape character A backslash at the end of the source has no escape character after it. Finish the escape and close the Text literal. Text
Text literal has unknown escape character «character» The character following a Text backslash is not a supported escape or the start of a hex escape. Use a supported escape, or remove the backslash if the character should be literal. Text
Text literal has hex escapes that form invalid UTF-8 Hex escapes decode to an invalid UTF-8 sequence. Encode the intended Unicode character with a valid UTF-8 byte sequence. Text
«character» has no matching opener A closing delimiter has no open matching construct. Add the opener or remove the extra closer. Block, Dict, Tuple
«opener» is closed by «closer» The closing delimiter has a different kind from the innermost opener. Use its matching closer and preserve nesting order. Block, Dict, Tuple
Member access has no name after «@» A .@ member-read prefix has no following name. Put the intended member name immediately after .@. NameReadMember
Member access has no name after «!» A .! member-write prefix has no following name. Put the intended member name immediately after .!. NameWriteMember
Name has unexpected character «character» Name parsing encounters a reserved special character. Correct the name, or separate the adjacent nodes with the required delimiter. Name
Line contains carriage return Strict node parsing encounters a carriage return. Use LF line endings, or -permissiveParsing if accepting carriage returns is intentional. Compiler options
«:» is not preceded by a name A colon appears without a preceding name. Attach it to a name label or remove it. Label and Variable
"»" has no matching opener A closing Text guillemet appears without an open guillemet literal. Add the opening « or remove the extra ». Text
Number starts with zero A number starts with zero followed by another decimal digit. Remove redundant leading zeroes or use the intended explicit number form. Integer literals, Real literals
Number has unexpected character «character» after «x» A 0x prefix is not followed by a valid hexadecimal digit. Supply a digit in 0–9 or A–F. Integer literals
Number has hex digit «character» in decimal integer A decimal integer contains an uppercase hexadecimal digit, including an uppercase E meant as the exponent marker of a real literal. Add the 0x prefix if hexadecimal was intended, use only decimal digits, or write the exponent with the lowercase e. Integer literals, Real literals
Number has unexpected character «character» A number contains an unexpected character. Correct the numeric spelling or separate the number from the following node. Integer literals, Real literals
Line ends with space Strict parsing finds a space immediately before a newline. Remove that space, or use -permissiveParsing if accepting it is intentional. Compiler options
Text literal is unterminated, expected «"» A double-quoted Text literal reaches end of input without its closing quotation mark. Add the closing quotation mark. Text
Text literal is unterminated, expected "»" A guillemet Text literal reaches end of input before it is closed. Balance nested guillemets and add the closing ». Text
Number overflows An integer literal exceeds the parser range for its literal form. Use a fitting value or a wider explicit integer or natural suffix; target-width Intx/Natx checks have separate diagnostics. Integer literals, Natural literals
Number has invalid suffix A numeric suffix is unsupported, incomplete, or followed by an invalid character. Use the complete suffix appropriate to the literal and a valid delimiter after it. Integer literals, Natural literals, Real literals
Negative number has natural suffix A literal written with a minus sign has a natural-number suffix. Remove the minus sign or use an appropriate signed integer suffix. Integer literals, Natural literals
Real number has hexadecimal prefix A literal beginning with 0x is being parsed as a Real number. Write the Real in decimal form or use a hexadecimal integer form. Real literals
Real number has non-digit character «character» after «.» The decimal point in a Real literal is not followed by a decimal digit. Supply a fractional digit, for example 1.0 rather than 1.. Real literals
Real number has exponent that starts with zero A multi-digit Real exponent begins with zero. Remove the redundant exponent zeroes or use a single zero exponent. Real literals
Real number has non-digit character «character» in exponent The exponent marker and optional sign are not followed by a decimal digit. Supply the exponent digits. Real literals
Real number has exponent greater than 308 The magnitude of the written exponent exceeds the parser limit of 308. Use an exponent that the parser accepts and a value representable in the requested Real schema. Real literals
Real number is malformed Conversion to the requested Real32/Real64 fails after lexical parsing; an out-of-range value can cause this, as with 9e308. Use a representable Real literal. Real literals
«opener» is unterminated An opening delimiter is still open at end of input. Close the construct with its matching delimiter. Block, Dict, Tuple

Program-requested failures

These entries describe failure mechanisms selected by the program; ordinary compiler-message and stack-printing builtins produce program-directed output instead.

Message Cause and fix See
text A visible raiseStaticError call supplies a known, non-NIL Text as the diagnostic message; the program or library defines its contents rather than mplc. Locate the call and satisfy or correct the precondition. raiseStaticError
failCompilation The program explicitly requests immediate compilation termination. Find the failCompilation call and correct the condition that reaches it, or remove an accidental call. failCompilation

Command line

These diagnostics are printed before any source is read; the process status is 2.

Message Cause and fix See
-callDepthLimit: Empty argument The supplied limit argument is an empty string. Supply an integral limit from 0 through 2,147,483,647. Compiler options
-staticLoopLengthLimit: Empty argument The supplied limit argument is an empty string. Supply an integral limit from 0 through 2,147,483,647. Compiler options
-callDepthLimit: Not a number The limit does not produce an accepted numeric value (NaN is also rejected by the source check). Supply an integral numeric limit. Compiler options
-staticLoopLengthLimit: Not a number The limit does not produce an accepted numeric value (NaN is also rejected by the source check). Supply an integral numeric limit. Compiler options
-callDepthLimit: Argument is not in [0, 2,147,483,648) The parsed numeric limit fails the range check. Use an integer from 0 through 2,147,483,647. Compiler options
-staticLoopLengthLimit: Argument is not in [0, 2,147,483,648) The parsed numeric limit fails the range check. Use an integer from 0 through 2,147,483,647. Compiler options
-callDepthLimit: Not an integer The accepted numeric limit is not integral. Supply an integer instead of a fractional value. Compiler options
-staticLoopLengthLimit: Not an integer The accepted numeric limit is not integral. Supply an integer instead of a fractional value. Compiler options
-D: Definition expected The -D option has no definition argument. Supply the definition after -D: NAME or NAME=MPL_SOURCE. Compiler options
-I: Folder path expected The -I option has no folder argument. Supply the source-search directory after -I. Compiler options
-callDepthLimit: Argument expected The -callDepthLimit option has no argument. Supply a non-negative integral limit from 0 through 2,147,483,647. Compiler options
-callTrace: Argument expected The -callTrace option has no argument. Supply the intended trace argument, normally 0 or 1. Compiler options
-debug is incompatible with -ndebug -debug follows -ndebug, but the flags are mutually exclusive. Keep only the mode you intend. Compiler options
-hidePrefix: Prefix expected The -hidePrefix option has no prefix argument. Supply the path prefix after -hidePrefix. Compiler options
-linked_option: Argument expected The legacy -linker_option flag (misspelled as -linked_option in the diagnostic) has no following argument. Supply the argument or remove the flag. Compiler options
-ndebug is incompatible with -debug -ndebug follows -debug, but the flags are mutually exclusive. Keep only the mode you intend. Compiler options
-o: Argument expected The -o option has no output-path argument. Supply the output path after -o. Compiler options
-staticLoopLengthLimit: Argument expected The -staticLoopLengthLimit option has no argument. Supply a non-negative integral limit from 0 through 2,147,483,647. Compiler options
Invalid command line parameter: «parameter» The dash-prefixed argument is not a recognized option. Correct or remove it; for version output use -version, not --version. Compiler options, Invocation

Internal errors

Message Cause and fix See
assertion An internal invariant check of the compiler failed; such checks are active only in compiler builds with DEBUG. This is not a rule of the program. Preserve the complete diagnostic, compiler version, and a small reproducer, and report a compiler defect. Diagnostics and status
Invalid node type The compiler encounters an invalid node marker that the MPL parser cannot produce. Not reachable from source code in this compiler version; report it as a compiler defect. Diagnostics and status, Processing model, Node table