Skip to content

Latest commit

Β 

History

History
83 lines (63 loc) Β· 3.5 KB

File metadata and controls

83 lines (63 loc) Β· 3.5 KB

🚨 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

  1. Extract β€” Scan language.md, targets.md, and ir.md for prohibition keywords: "must", "cannot", "only", "requires", "forbidden", "not supported", "rejected", "maximum", "minimum".

  2. 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.

  3. Map β€” Each violable constraint maps to at least one catalog entry. Some constraints produce multiple errors (e.g., "no subtraction" catches -, --, -=).

  4. 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
  5. 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