Diagnostics
Cleat produces Rustc-style diagnostics with source context, colored underlines, and helpful suggestions.
Format
text
error: type mismatch: expected int, got string --> main.cleat:2:5 | 2 | let x: int = "hello" | ^
Severity levels
| Level | Meaning |
|---|---|
| error | Compilation failure — must be fixed |
| warning | Potential issue — compilation succeeds |
| info | Advisory note |
Suggestion hints
The compiler uses Levenshtein distance to suggest corrections:
text
error: unknown effect "crpyto" in fn greet
--> main.cleat:1:27
|
1 | fn greet() -> int needs { crpyto } {
| ^^^^^^
= help: did you mean "crypto"?This works for effect names, variable names, struct field names, and method names.
Suppressing warnings
bash
cleat build main.cleat --no-warn
Useful for CI where warnings in build output are noise.
Real-time diagnostics
The language server (cleat lsp) provides these diagnostics as you type in VS Code. See Editor Setup.