Commit 13c22db
Exclude constant scalar types from TemplateMixedType narrowing in TypeCombinator::intersect()
Constant scalar values like 0, '', '0' should not be narrowed from
`0&T` to `T of 0` — the intersection form is more precise for constants.
Only general scalar types (int, string, float, bool) are narrowed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent e35ca44 commit 13c22db
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1403 | 1403 | | |
1404 | 1404 | | |
1405 | 1405 | | |
| 1406 | + | |
1406 | 1407 | | |
1407 | 1408 | | |
1408 | 1409 | | |
| |||
1425 | 1426 | | |
1426 | 1427 | | |
1427 | 1428 | | |
| 1429 | + | |
1428 | 1430 | | |
1429 | 1431 | | |
1430 | 1432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments