Commit c64d42c
committed
fix(tables): check conversions against the target column, not a rebuilt stub
Bugbot flagged that the conversion gate calls `isValueCompatibleWithType`,
which hand-builds a column from loose arguments and never sets
`currencyCode` — while the coercion a few lines later reads the real one.
The reported impact does not occur. Whether an amount parses does not depend
on the currency, only which number it yields, so the gate and the coercion
always agree on accept/reject; and the value written back is already coerced
against the real column, so no cell is stored wrong. I checked this rather
than argued it: across nine currency codes and every separator shape in the
parser's repertoire, acceptance never diverged.
The stub is still worth removing. It is correct only because of an invariant
nobody wrote down, and `convertedColumn` — sitting right there, whose own
comment already says it exists so the scan reads the same option set and
currency — is what the gate should have used all along.
So the gate now takes the target column itself. The loose-argument form moves
into the test file as local marshalling, leaving production with only the
whole-column shape, which cannot silently drop a key a future type adds.
No behavior change, so no test changes: a currency-divergence regression test
could not fail today, and pinning an invariant this removes the need for would
only block a legitimate future change.1 parent 6a47267 commit c64d42c
2 files changed
Lines changed: 38 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
16 | 37 | | |
17 | 38 | | |
18 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
| 804 | + | |
813 | 805 | | |
814 | 806 | | |
815 | 807 | | |
| |||
1330 | 1322 | | |
1331 | 1323 | | |
1332 | 1324 | | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1338 | 1337 | | |
1339 | 1338 | | |
1340 | 1339 | | |
1341 | 1340 | | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | | - | |
1347 | | - | |
1348 | | - | |
| 1341 | + | |
1349 | 1342 | | |
1350 | 1343 | | |
1351 | | - | |
1352 | | - | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
1356 | | - | |
1357 | | - | |
| 1344 | + | |
1358 | 1345 | | |
0 commit comments