Commit 61d5810
Make typed GetUnitInfo overload return UnitInfo<TQuantity, TUnit>
Replaces the IQuantity<TUnit> -> UnitInfo<TUnit> overload with
IQuantity<TQuantity, TUnit> -> UnitInfo<TQuantity, TUnit>, so the
typed extension returns the most specific UnitInfo shape when the
caller has a concretely-typed quantity (e.g. Length).
Behavior:
- Length q; q.GetUnitInfo() -> UnitInfo<Length, LengthUnit>
- IQuantity q; q.GetUnitInfo() -> UnitInfo (non-generic fallback)
- IQuantity<TUnit> q; q.GetUnitInfo() -> UnitInfo (non-generic fallback)
The IQuantity<TUnit> reference case loses its typed UnitInfo<TUnit>
return, but that scenario is uncommon compared to the concretely-typed
receiver case which now returns the richer UnitInfo<TQuantity, TUnit>.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8a9d731 commit 61d5810
2 files changed
Lines changed: 35 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
95 | 110 | | |
96 | 111 | | |
97 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | | - | |
| 31 | + | |
26 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
27 | 40 | | |
28 | 41 | | |
29 | | - | |
30 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
| |||
0 commit comments