Skip to content

Errors & Warnings

What to do about the common ones is in Fix Language Errors.

WhereWhat it shows
resonon run, resonon view console, the REPLThe full text, with the location. A parse error adds the source line and a caret.
VSCode Problems panel and underlinesThe text without the location, underlined where it happened, with the kind’s code beside it.

A location is path:line:column, or line:column for code that has no file. Some errors have no location, and print their text alone.

Parse error at /home/me/song/src/main.non:1:12: expected neg, pos, not, or primary
|
1 | let x = 1 +;
| ^

resonon run exits with status 1 after an error.

ErrorWhat runs
A parse errorNothing of the file or selection. Every parse error in it is reported, up to 100.
A definition repeated in one file or selectionNothing of it. Every repeat is reported.
Any other errorEverything before the statement that raised it.
A warningEverything; the warning is printed as Warning: ….

The code is what VSCode shows beside the message.

CodeTextRaised by
parseParse error at L: …Code that does not fit the grammar, a note literal above MIDI 127 (B9: Invalid note 'B9'), or a definition written inside a function or block.
runtimeRuntime error at L: …A failure with no kind of its own: a bad argument value, a failed operation.
typeType error at L: expected X, got YA value of the wrong type for an operator, a function argument, a condition or an annotation.
undefined_variableUndefined variable 'x' at LA name that is not defined.
undefined_functionUndefined function 'f' at LA call of a name that is not defined.
undefined_methodUndefined method 'm' for type T at LA method the value’s type does not have.
undefined_propertyUndefined property 'p' for type T at LA field a class instance does not have.
arity_mismatchArity mismatch at L: 'f' expects N arguments, got MToo few or too many arguments. N is a number, a range min-max, or variadic.
division_by_zeroDivision by zero at L/ or % by 0.
index_out_of_boundsIndex out of bounds at L: index I is out of range for length NAn array, tuple or string index past its end.
assertion_failedAssertion failed at L: messageAn assert whose condition is false. Without a message: Assertion failed at L.
borrow_errorBorrow error at L: …A class instance changed while resonon itself still holds it. It should not happen; report it.
private_accessCannot access private 'x' in module 'm' at LA private definition used from outside its module.
module_not_foundRuntime error at L: Module 'p' not found. Searched: and each folder searchedA use path found in no search path.
duplicate_definitionDuplicate definition at L: fn 'f' repeats the fn at L2. and a line saying what to doA name bound twice in one file or selection — by two definitions, a let and a definition, or a use and anything else.
dspDSP error at L: …A dsp block that does not compile. See DSP Code.
plugin_skippedRuntime error at L: …A plugin that the plugin scan skipped after it crashed. The editor offers to retry it.
version_mismatchRuntime error at L: …Code from a project that needs a newer resonon than the server runs. The editor offers to restart the server.

L is the location.

The editor checks code as you type, without running it, and runs no code to confirm what it finds.

FoundSeverity
After you evaluate: any errorError
As you type: parse, duplicate_definition, dsp, module_not_found, undefined_*, arity_mismatch, private_accessError
As you type: type, runtime, division_by_zero, index_out_of_bounds, assertion_failed, borrow_errorWarning

Errors found as you type stay until the code changes; errors from an evaluation clear at your next evaluation.

In Live Mode (online), a duplicate_definition between two top-level bindings in the file is not shown: each selection is evaluated on its own. File Mode (offline) shows them.

These come from the language server, not from running code:

CodeSeverityWhereMeaning
kit-unportableInformation.nonA Kit("…") whose kit is outside the project and not listed under [local].
kit-missingWarningresonon.tomlA [local] kits entry found nowhere.
kit-outside-projectInformationresonon.tomlA [local] kits entry found only outside the project.
kit-travels-anywayHintresonon.tomlA [local] kits entry for a kit that travels anyway — in the project, a dependency, or the kits resonon ships — so the entry does nothing.
manifest-unknown-keyWarningresonon.tomlA key resonon does not read.
manifest-syntaxErrorresonon.tomlTOML that does not parse.