Diagnostics
Every error and warning the compiler emits has a code — E100, E618, etc. The code is the stable name for that class of problem: the message wording may improve between releases, but the code doesn't change.
How to read a diagnostic
A typical message looks like:
error: could not infer type [E100]
┌─ src/main.ks:3:14
│
3 │ let xs = [];
│ ^^ add a type annotation
error— the severity. The compiler emits warnings in the same format.[E100]— the diagnostic code, printed at the end of the message.- The location —
file:line:column, with the offending source underlined. - The caret note — the compiler's best guess at a fix. Here, an annotation resolves it:
let xs: [Int64] = [];.
The suggested fix isn't always right — it's a heuristic. If a diagnostic is confusing, reduce the snippet until the cause is obvious.
Codes
Codes are allocated roughly by compiler phase (parsing, name resolution, type inference, protocol resolution, ownership checking, lowering), but the ranges are an implementation detail — treat each code as an opaque, stable identifier rather than reading meaning into its number.
A searchable per-code index with explanations and canonical fixes is planned for this page. Until it lands:
- Read the caret note and any attached help text — most diagnostics explain the fix inline.
- Search the issue tracker for the code.
- If a diagnostic is misleading or undocumented, file an issue — confusing errors are treated as bugs.