Skip to content

Compiler messages

When a script does not compile, the editor underlines the spot and shows a message with an id such asV0302. Find the id below for what it means and how to fix it.

Reading the text

A character or literal the language cannot read.

V0001 lex

The source holds a character or literal the language has no reading for: an unterminated string, an escape it does not know, a number it cannot parse, or a symbol outside the grammar. Fix the text at the underlined position; nothing after it was read.

Understanding the shape

The words are fine, but they are not in an order the language allows.

V0101 parse

The text was read but did not match the grammar at the underlined position. The message names what was found and what could have stood there. A statement that runs onto the next line without a terminator is the usual cause.

Finding names

A name that is not declared, declared twice, or a parent that cannot be found.

V0201 unknown name

A name is used that nothing in scope declares: not a local, a parameter, a module `let`, a function, an enum or an inherited member. Check the spelling against the declaration; the help offers the nearest one when there is a close match.

V0202 duplicate name

The same name is declared twice in one scope. Rename one of them; a later `let` does not shadow an earlier one at the same level.

V0203 parent not found

The script declares `super "…"` and the parent at that path could not be loaded, so every inherited name is unknown. Check the path against the game data, and that the tool was given a game directory to read it from.

Checking calls and values

A call or value that does not fit what it is given to.

V0301 unknown function

A bare call names a function this script does not define and its parent does not export. Engine natives are called with a `$namespace.` prefix; script functions must be declared in this file or an ancestor.

V0302 unknown external

A `$namespace.name` call names a native the engine does not register. The namespace and name must match the engine's table exactly; the editor's completion lists every one.

V0303 arity mismatch

A call passes a different number of arguments from what the callee accepts. A native that derives hash arguments accepts two counts — with every derivable hash written, or with all of them left out.

V0304 type mismatch

An argument has a type no overload of the native accepts at that position. The message names the type found and the shapes that would be accepted.

V0305 hash mismatch

A hash argument is written by hand and does not equal the hash of the string literal beside it. Write the number the message gives, or leave every derivable hash out and let the compiler derive them.

V0306 hash not derivable

A hash argument is left out beside an operand that is not a string literal, so the compiler cannot derive it without evaluating the operand twice. Write the hash explicitly — omitting derivable hashes is all or nothing per call.

V0307 void value

A call that returns nothing is used where a value is needed. Call it as a statement, or call a function that returns a value.

V0308 untyped global

A module-level `let` has no type annotation and is not initialised with a literal, so its storage type cannot be inferred. Write the type: `let name: int = …`. A `let` inside a function may omit it.

V0309 unsupported

The construct is valid to read but the compiler has no lowering for it yet — a list method it does not know, a shape outside the supported subset. Rewrite with a supported form, or file it if the shipped scripts use it.

V0311 unknown parameter

A keyword argument names a parameter the called function does not declare. The note lists the parameters it has; check the spelling against the declaration, or pass the argument by position.

V0312 unsupported global type

A module-level field's record names one concrete storage type, so it cannot be `var` (or any type the container has no record for). Declare the type it holds: `User`, `Entity`, `Component`, `Reference`, `int`, … A `let` inside a function may be `var`.

Building the script

Everything checked out, but the result could not be assembled.

V0401 write

Everything compiled, but the container could not be assembled or serialised. The message carries the writer's reason; this is not usually the script's fault.

Editing a shipped script

Seen when you open a shipped script to change it.

V0310 decompile fallback

This function was not decompiled: its bytecode is kept above as comments and the marker call refuses to compile. Write the body by hand from the comments, or delete the function to inherit the parent's.

V0801 not decompiled

The decompiler could not turn this function's bytecode back into source: its lifter or its control-flow structurer met a shape it does not know. The source keeps the bytecode as comments in the function's place; the message carries the stage and its reason. Editing the script means writing this body by hand, or deleting the function to inherit the parent's.

Compiler defects

Not your mistake. Report it with the script that caused it.

V0901 unknown global

The compiler lost track of a module-level name after resolving it. This is a defect in the compiler, not in the script; report it with the script that triggers it.