Errors & Warnings
What to do about the common ones is in Fix Language Errors.
Where an error is shown
Section titled “Where an error is shown”| Where | What it shows |
|---|---|
resonon run, resonon view console, the REPL | The full text, with the location. A parse error adds the source line and a caret. |
| VSCode Problems panel and underlines | The 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.
When code stops
Section titled “When code stops”| Error | What runs |
|---|---|
| A parse error | Nothing of the file or selection. Every parse error in it is reported, up to 100. |
| A definition repeated in one file or selection | Nothing of it. Every repeat is reported. |
| Any other error | Everything before the statement that raised it. |
| A warning | Everything; the warning is printed as Warning: …. |
The code is what VSCode shows beside the message.
| Code | Text | Raised by |
|---|---|---|
parse | Parse 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. |
runtime | Runtime error at L: … | A failure with no kind of its own: a bad argument value, a failed operation. |
type | Type error at L: expected X, got Y | A value of the wrong type for an operator, a function argument, a condition or an annotation. |
undefined_variable | Undefined variable 'x' at L | A name that is not defined. |
undefined_function | Undefined function 'f' at L | A call of a name that is not defined. |
undefined_method | Undefined method 'm' for type T at L | A method the value’s type does not have. |
undefined_property | Undefined property 'p' for type T at L | A field a class instance does not have. |
arity_mismatch | Arity mismatch at L: 'f' expects N arguments, got M | Too few or too many arguments. N is a number, a range min-max, or variadic. |
division_by_zero | Division by zero at L | / or % by 0. |
index_out_of_bounds | Index out of bounds at L: index I is out of range for length N | An array, tuple or string index past its end. |
assertion_failed | Assertion failed at L: message | An assert whose condition is false. Without a message: Assertion failed at L. |
borrow_error | Borrow error at L: … | A class instance changed while resonon itself still holds it. It should not happen; report it. |
private_access | Cannot access private 'x' in module 'm' at L | A private definition used from outside its module. |
module_not_found | Runtime error at L: Module 'p' not found. Searched: and each folder searched | A use path found in no search path. |
duplicate_definition | Duplicate definition at L: fn 'f' repeats the fn at L2. and a line saying what to do | A name bound twice in one file or selection — by two definitions, a let and a definition, or a use and anything else. |
dsp | DSP error at L: … | A dsp block that does not compile. See DSP Code. |
plugin_skipped | Runtime error at L: … | A plugin that the plugin scan skipped after it crashed. The editor offers to retry it. |
version_mismatch | Runtime 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.
Severity in the editor
Section titled “Severity in the editor”The editor checks code as you type, without running it, and runs no code to confirm what it finds.
| Found | Severity |
|---|---|
| After you evaluate: any error | Error |
As you type: parse, duplicate_definition, dsp, module_not_found, undefined_*, arity_mismatch, private_access | Error |
As you type: type, runtime, division_by_zero, index_out_of_bounds, assertion_failed, borrow_error | Warning |
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.
Editor-only diagnostics
Section titled “Editor-only diagnostics”These come from the language server, not from running code:
| Code | Severity | Where | Meaning |
|---|---|---|---|
kit-unportable | Information | .non | A Kit("…") whose kit is outside the project and not listed under [local]. |
kit-missing | Warning | resonon.toml | A [local] kits entry found nowhere. |
kit-outside-project | Information | resonon.toml | A [local] kits entry found only outside the project. |
kit-travels-anyway | Hint | resonon.toml | A [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-key | Warning | resonon.toml | A key resonon does not read. |
manifest-syntax | Error | resonon.toml | TOML that does not parse. |