Commit 72f2b6e
Skip trivially-always-true conditions in processBooleanNotSureConditionalTypes
Apply the same fix from processBooleanSureConditionalTypes to its
symmetric counterpart. When TypeCombinator::intersect(scopeType, type)
returns the scope type unchanged, the condition is trivially always
true and should be skipped to avoid creating spurious conditional
expression holders.
The other TypeCombinator::remove calls (in AssignHandler and on the
result side of processBooleanNotSureConditionalTypes) cannot be fixed
the same way because their holders carry createYes certainty that
matters for conditionally-defined variables — even when the type
itself doesn't change.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 909a316 commit 72f2b6e
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2066 | 2066 | | |
2067 | 2067 | | |
2068 | 2068 | | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
2069 | 2075 | | |
2070 | 2076 | | |
2071 | | - | |
| 2077 | + | |
2072 | 2078 | | |
2073 | 2079 | | |
2074 | 2080 | | |
| |||
0 commit comments