Skip to content

feat: infer quantity dimensions through local initialisers - #4

Merged
ScottishTapWater merged 1 commit into
mainfrom
feat/local-quantity-inference
Oct 22, 2026
Merged

ScottishTapWater merged 1 commit into
mainfrom
feat/local-quantity-inference

Conversation

@ScottishTapWater

Copy link
Copy Markdown
Contributor

Summary

  • Infer quantity dimensions through ordinary var local initialisers and copied locals, so arithmetic can be split across statements.
  • Separate expression analysis from arithmetic candidate discovery, with symbol-based local caching and cycle detection scoped to each analysis.
  • Preserve bound types and declaration-based inference; do not infer from later assignments or unresolved explicit type names.
  • Add tests for dependency chains, scalar factors, reused locals, scope identity, incomplete/cyclic code and incremental edits/removal.
  • Keep each Roslyn test class in one file and update the README scope statement.
var squared = current * current;
var heating = squared * resistance;
var energy = heating * time;

Verification

  • Tests written first: 12 new cases failed before implementation.
  • 410 tests pass: 306 core, 103 Roslyn and 1 packaged-consumer integration test.
  • C# production and test reviews completed, followed by a second pass after coverage fixes and a final review after test consolidation.
  • Explicit checks for test ownership and overgrown class responsibilities found no remaining issues.
  • Formatting check passes with the existing RS1041 diagnostic excluded; diff whitespace check passes.

Roots, powers, dimensionless results and unresolved explicit type-name inference remain outside this slice.

@ScottishTapWater
ScottishTapWater merged commit f4e842d into main Oct 22, 2026
2 checks passed
@ScottishTapWater
ScottishTapWater deleted the feat/local-quantity-inference branch October 22, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant