07.6 Read a diagnostic
Spans, severity, diagnostic codes, and fixing problems instead of debating them."
Read a diagnostic
The compiler is not your therapist. It will not validate your architecture feelings. It will point at a span and expect action.
Anatomy of a report
Section titled “Anatomy of a report”Typical CLI output (miette-style):
- Message — what went wrong in human language
- Span — file + line range
- Hint / help — sometimes suggests a fix
- Code — stable diagnostic id when registered
Registry hub: diagnostic code registry.
Severity discipline
Section titled “Severity discipline”| Severity | Your job |
|---|---|
| Error | Fix before ship |
| Warning | Fix or document why ignored |
| Info | Usually style/education |
Workflow
Section titled “Workflow”flowchart TD
D[See diagnostic] --> R[Read span first]
R --> M[Minimize repro file]
M --> C{Language or project?}
C -->|syntax| P[parse/tree]
C -->|types/names| A[analyze]
A --> S[Check spec + reference rules]
When the message feels wrong
Section titled “When the message feels wrong”Sometimes the message is accurate but the root cause is two modules away (bad pub use, wrong Project.proj root). Follow imports and manifest roots before opening compiler issues.
Related tutorial pages
Section titled “Related tutorial pages”Where to go next
Section titled “Where to go next”Public API idioms and documentation comments live in later book entries and platform spec. You now have enough vocabulary to read real Beskid code without treating the analyzer as malice.