Error diagnosis
The Wave compiler displays errors along with the code (E####), source location/context, and resolution hints all at once.
Output format
The basic format is as follows.
error[E3001]: semantic validation failed: use of undeclared identifier `x`
--> file.wave:2:18
1 | fun main() {
2 | println("{}", x);
| ^ not found in this scope
= context: semantic validation
= help: fix mutability, scope, and expression validity issues
Output items:
error[E....]: Error code and summary--> file:line:column: Location of the issue- Source block + caret(
^) highlight context,expected,found,note,help,suggestion
Representative error codes
E1001Unexpected characterE1002Unclosed block commentE1003Unclosed stringE1004Invalid string escapeE1005Invalid character literalE1006Invalid numeric literal formatE2001Parser syntax errorE3001Semantic validation errorE3102Assignment ofnullto non-pointerE3201Prohibition of implicit integer narrowingE9001Backend code generation internal error
Backend errors also show source location
Even if an internal panic occurs during the code generation (LLVM) phase, the actual call/declaration location is inferred and displayed if possible.
error[E9001]: compiler internal error during code generation (llvm-ir-generation)
--> test.wave:12:9
= found: Function 'foo' not found
= note: source position inferred from unresolved function name in backend panic
If location inference is not possible, a fallback location is used, and this fact is indicated in the note.