Summary
CLAUDE.md documents the public API as:
PhysicalConstants.Generic.SpeedOfLight<T>()
PhysicalConstants.Generic.PlanckConstant<T>()
PhysicalConstants.Conversion.FeetToMeters<T>()
The generated PhysicalConstants class does not expose any Generic or Conversion sub-class with type-parameterised accessors. It only emits non-generic PreciseNumber static readonly fields nested in domain-specific subclasses (AngularMechanics, Chemistry, …).
Evidence
Semantics.Quantities/Generated/.../PhysicalConstants.g.cs:16-50:
public static class PhysicalConstants {
public static class AngularMechanics {
public static readonly PreciseNumber DegreesPerRadian = PreciseNumber.Parse("...");
}
public static class Chemistry { ... }
...
}
No Generic or Conversion partition; no <T> accessors.
Impact
- Public API surface mismatches CLAUDE.md and existing examples.
- Generic physics quantity code that calls
PhysicalConstants.Generic.PlanckConstant<T>() will not compile.
- The
PhysicalConstantsGenerator is partially wired up.
Suggested next step
Either:
- Extend
PhysicalConstantsGenerator to also emit PhysicalConstants.Generic.{Constant}<T>() and PhysicalConstants.Conversion.{Factor}<T>() accessors that wrap the PreciseNumber values via T.CreateChecked(...), or
- Update
CLAUDE.md and any docs/code samples to match the simpler nested-subclass shape.
Add coverage in Semantics.Test to lock in the chosen API.
Area / Severity
SourceGenerators / Quantities · incomplete
Summary
CLAUDE.mddocuments the public API as:The generated
PhysicalConstantsclass does not expose anyGenericorConversionsub-class with type-parameterised accessors. It only emits non-genericPreciseNumberstatic readonly fields nested in domain-specific subclasses (AngularMechanics,Chemistry, …).Evidence
Semantics.Quantities/Generated/.../PhysicalConstants.g.cs:16-50:No
GenericorConversionpartition; no<T>accessors.Impact
PhysicalConstants.Generic.PlanckConstant<T>()will not compile.PhysicalConstantsGeneratoris partially wired up.Suggested next step
Either:
PhysicalConstantsGeneratorto also emitPhysicalConstants.Generic.{Constant}<T>()andPhysicalConstants.Conversion.{Factor}<T>()accessors that wrap thePreciseNumbervalues viaT.CreateChecked(...), orCLAUDE.mdand any docs/code samples to match the simpler nested-subclass shape.Add coverage in
Semantics.Testto lock in the chosen API.Area / Severity
SourceGenerators / Quantities · incomplete