Errors

Every diagnostic code of Synod has a page: what it means, a minimal program that triggers it, and the fix. The programs run in your browser.

Compile-time codes

CodeMeaning
syntaxThe structure grammar cannot parse the line.
indentThe indentation of a line is wrong.
non-canonicalThe code can be read but is not written in canonical form.
bad-headerThe file's package header is missing or wrong.
unknown-phraseNo phrase matches the sentence by its shape.
ambiguous-phraseMore than one phrase matches the sentence by its shape.
duplicate-nameA name is defined twice in one namespace.
shadowingA name hides another name that is already in scope.
reserved-wordA reserved word is used as a name or a head.
bad-patternA `define` or `when` pattern breaks the pattern rules.
bad-receiverA receiver is of the wrong type or in the wrong place.
bad-place`set` targets something that cannot be set.
type-mismatchA value has a type that is not accepted where it is used.
ambiguous-emptyThe type of `{}` cannot be told.
missing-resultA value phrase has a path that does not reach `result`.
value-as-statementA phrase that gives a value stands where a statement is expected.
action-as-valueA phrase that gives no value is used as a value.
unexportedA lower-case name from another package is used.
unused-nameA local or `each` name is never read.
unused-importAn import is never used.
unneeded-alias`use … as` is written where there is no collision.
unknown-importAn import path does not name a library package.
import-cyclePackages import each other in a circle.
missing-mainA main file has no `define main`, or `synod run` finds no main file.
extra-mainA folder has more than one `define main`, or `define main` is in a library file.
contextA statement is not allowed in the context it runs in.
foreign-stateNode code reaches another node's state.
color-literalA color literal stands where only a named color is allowed.
native-outside-std`native` is used outside `std/`.

Run-time codes

CodeMeaning
missing-keyA map was asked for a key it does not hold.
index-rangeA list index is not a whole number from 0 up to one less than the size of the list.
disk-typeA value read from a node's disk does not have the type of the default given to `disk.Read`.
division-by-zeroA number or a time was divided by zero.
nobody`sim.Nobody` was used where a node is needed.
time-limitThe next event is later than 10 minutes of simulated time.
bad-argumentAn argument is outside the domain of the phrase that received it.
number-rangeA calculation gave a number that is not finite, or a time that does not fit in 64 bits.
run-limitThe run exceeded one of the limits that keep a program from running forever.