Version: dev

unit_finding_dimensional_mismatch

Stable constant · Units

Tier: stable · Kind: constant · Topic: Units

JuliaTypeScriptPythonRustGo
not exportednot exportedUNIT_FINDING_DIMENSIONAL_MISMATCHUNIT_FINDING_DIMENSIONAL_MISMATCHUnitFindingDimensionalMismatch

Julia

Julia does not export this constant.

TypeScript

TypeScript does not export this constant.

Python

UNIT_FINDING_DIMENSIONAL_MISMATCH = 'dimensional_mismatch'

A PROVABLE inconsistency: metres added to kilograms, an equation whose sides cannot agree. The file is wrong.

Source

Rust

pub const UNIT_FINDING_DIMENSIONAL_MISMATCH: &str = crate::diagnostic::codes::DIMENSIONAL_MISMATCH;

The cross-binding code values a dimensional finding can carry, as surfaced on crate::validate::UnitWarning::code. Mirrors Go’s UnitFinding* constants (pkg/earthsci-ast-go/pkg/esm/units.go) and TypeScript’s UnitWarning['code'] union (pkg/earthsci-ast-ts/src/units.ts).

  • UNIT_FINDING_DIMENSIONAL_MISMATCH — a PROVABLE inconsistency: adding metres to kilograms, an equation whose sides cannot agree. A defect in the FILE; this binding promotes it to a unit_inconsistency structural error.
  • UNIT_FINDING_UNPARSEABLE — a declared unit string that does not denote a real unit. Also a defect in the FILE; promoted to unit_parse_error at the declaration’s own pointer.
  • UNIT_FINDING_ANALYSIS — the checker cannot DETERMINE a dimension. A limit of the ANALYSIS, not a defect, so it stays a non-blocking warning.

These strings are a cross-binding contract; they must not change.

Source · Rust docs

Go

const UnitFindingDimensionalMismatch = "dimensional_mismatch"

Unit-finding codes. A unit finding is either a DEFECT IN THE FILE — which invalidates the document — or a limit of the ANALYSIS, which does not. The classification is decided at the point the finding is raised (never recovered later from the prose) and carried on UnitWarning.Code; ValidateStructuralWithCodes promotes the defect-bearing codes to unit_inconsistency structural errors.

The split is the cross-binding policy and mirrors TypeScript’s units.ts:

  • UnitFindingDimensionalMismatch — a PROVABLE inconsistency: adding metres to kilograms, log() of a dimensional quantity, an equation whose sides have different dimensions. The file is wrong. → HARD ERROR.
  • UnitFindingUnparseable — a declared unit string that does not denote a real unit (“not_a_unit”). The file is wrong. → HARD ERROR.
  • UnitFindingAnalysis — the checker cannot DETERMINE a dimension: a symbolic (non-literal) exponent, an operator with no dimensional rule (fn/table_lookup), a malformed arity. That is a statement about the checker, not a defect in the file. → WARNING.
  • UnitFindingDimensionlessLiteral — the esm-spec §4.8.6 warning stage: a site that fails only when nonzero bare literals are dimensionless. Never promoted. → WARNING.

An unknown VARIABLE is likewise never a mismatch (it propagates as “unknown” and suppresses the check); it is separately a hard undefined_variable error, so the units layer does not double-report it.

Source · Go docs