๐จ Error Catalog
โ Language Reference | IR Reference | Target Reference
All Trident compiler diagnostics โ errors, warnings, and optimization hints. Derived from the language specification (language.md), target constraints (targets.md), and IR tier rules (ir.md).
This catalog is the source of truth for diagnostics. If a rule in the reference can be violated, the error must exist here. Entries marked (planned) are specification-required but not yet implemented in the compiler.
Derivation Methodology
The catalog is derived systematically from the specification, not reverse-engineered from compiler source. Every violable rule produces at least one diagnostic entry.
The 5-step process
-
Extract โ Scan language.md, targets.md, and ir.md for prohibition keywords: "must", "cannot", "only", "requires", "forbidden", "not supported", "rejected", "maximum", "minimum".
-
Classify โ Is the constraint user-violable? Internal compiler invariants don't need user-facing errors. Only rules that a programmer could break in source code qualify.
-
Map โ Each violable constraint maps to at least one catalog entry. Some constraints produce multiple errors (e.g., "no subtraction" catches
-,--,-=). -
Audit โ Gaps cluster in predictable categories:
- Excluded-feature diagnostics (every Rust/C keyword users try)
- Tier-gating for compound features (seal uses sponge internally)
- Semantic domain errors (inv(0), hash rate mismatches)
- Attribute argument validation
-
Maintain โ When adding a language feature, add its violation modes to the catalog simultaneously. The spec change and the error entry ship together.
Completeness claim
165 diagnostics cover every user-violable "must"/"cannot"/"only" constraint in the language reference (language.md, grammar.md), targets.md, and ir.md. The derivation was audited by scanning all reference documents for prohibition keywords and cross-referencing each against the catalog.
Categories
| Category | File | Total | Impl | Planned |
|---|---|---|---|---|
| Lexer | lexer.md | 20 | 7 | 13 |
| Parser | parser.md | 29 | 8 | 21 |
| Type | types.md | 40 | 24 | 16 |
| Control flow | control-flow.md | 8 | 6 | 2 |
| Size generics | size-generics.md | 6 | 4 | 2 |
| Events | events.md | 7 | 5 | 2 |
| Annotations | annotations.md | 8 | 3 | 5 |
| Module | modules.md | 10 | 4 | 6 |
| Target | targets.md | 16 | 3 | 13 |
| Builtin type | builtins.md | 7 | 0 | 7 |
| Inline assembly | assembly.md | 2 | 0 | 2 |
| Warnings | warnings.md | 7 | 3 | 4 |
| Hints | hints.md | 5 | 4 | 1 |
| Total | 165 | 71 | 94 |
๐ See Also
- Language Reference โ Types, operators, builtins, grammar
- Target Reference โ OS model, integration tracking, how-to-add checklists
- IR Reference โ 54 operations, 4 tiers, lowering paths
- Tutorial โ Step-by-step guide with working examples
- For Offchain Devs โ Why bounded loops? Why no heap?
- Optimization Guide โ Cost reduction strategies