Commit 79d59d6
Explain why getFiniteTypes() guard is needed in Pass 2 condition matching
Address reviewer question about why isSuperTypeOf cannot be used for all
types. Conditional expression holders come from multiple sources (param
conditional types, scope merging, assignment handlers, TypeSpecifier
boolean processing). Non-finite condition types from scope merging and
assignment handlers are too broad for isSuperTypeOf matching — e.g.
non-falsy-string incorrectly matches 'filter', or mixed~false matches
false, causing conflicting conditional expressions to produce *NEVER*.
The finite types check restricts Pass 2 to closed sets of concrete
values where subtype matching is safe.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 6f358cd commit 79d59d6
1 file changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3235 | 3235 | | |
3236 | 3236 | | |
3237 | 3237 | | |
| 3238 | + | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
3238 | 3255 | | |
3239 | 3256 | | |
3240 | 3257 | | |
| |||
0 commit comments