Skip to content

QuantitiesGenerator silently ignores broken dimension references in dimensions.json #56

@matt-edmondson

Description

@matt-edmondson

Summary

When the generator looks up dimension references for relationships (integrals, derivatives, dot/cross products, overload base types) it uses try-get on a dimension map and continues silently when the reference is missing. A typo like "result": "Forec1D" or a stale name from a renamed dimension produces no diagnostic — the operator just isn't generated.

Evidence

Semantics.SourceGenerators/Generators/QuantitiesGenerator.cs around the relationship/operator emission code (e.g. ~lines 125-127, 245-278) does dimension-map lookups without diagnostics on miss.

Impact

  • Hard to notice when a relationship that was supposed to exist quietly disappears from generated output.
  • Major risk while iterating on the unified vector representation, where dimensions.json is being heavily edited.

Suggested next step

When a referenced dimension cannot be resolved, emit a Roslyn diagnostic (ReportDiagnostic) with a clear ID, e.g. SEM001: relationship 'Force * Distance -> Enrgy' references unknown dimension 'Enrgy'. Treat at least typo-class lookups as warnings; consider failing the build for unknown references in CI.

Area / Severity

SourceGenerators · bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions