Skip to content

No tests for semantic overload conversions (Weight, Drag, Distance, Diameter, …) #55

@matt-edmondson

Description

@matt-edmondson

Summary

The generator emits "semantic overload" types — narrower-named aliases of a base quantity, with implicit widening to the base, explicit narrowing from the base, and a From() factory. Examples: Weight over ForceMagnitude, Drag/Friction over Force1D, Distance/Depth/Altitude over Length, Diameter/Radius over Length.

Nothing in Semantics.Test covers any of this.

Evidence

Semantics.Quantities/Generated/.../Weight.g.cs and similar files emit:

  • public static implicit operator ForceMagnitude<T>(Weight<T> v)
  • public static explicit operator Weight<T>(ForceMagnitude<T> v)
  • public static Weight<T> From(ForceMagnitude<T> v)

Semantics.Test/ has no file referencing Weight, Drag, Diameter, Radius, or any other overload type.

Suggested next step

Add tests that:

  1. Round-trip through implicit + explicit operators preserves value.
  2. Weight + Weight stays Weight (verify operator preservation), but Weight + ForceMagnitude falls back to base ForceMagnitude (or whichever rule the generator chose — see also Resolve open design decision for Vector0 subtraction #52).
  3. Diameter.ToRadius() / Radius.ToDiameter() use the metadata-defined relationship (Value / 2, Value * 2).
  4. Cross-storage-type round-trips for double, float, decimal.

Area / Severity

Tests · incomplete

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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