Commit 7a57c23
Generalize NeverType handling for member access in MutatingScope
Move the NeverType-instead-of-ErrorType fix from individual handlers
(PropertyFetchHandler, MethodCallHandler) to MutatingScope::resolveType().
This provides a single central fix: when any handler returns ErrorType for
a member access on NeverType (dead code branch after type narrowing), it is
converted to NeverType. This ensures TypeCombinator::union() correctly
eliminates the dead branch type instead of polluting the union with mixed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 79bbb0c commit 7a57c23
3 files changed
Lines changed: 21 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | 292 | | |
298 | 293 | | |
299 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 93 | | |
100 | 94 | | |
101 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
982 | 982 | | |
983 | 983 | | |
984 | 984 | | |
985 | | - | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
986 | 997 | | |
987 | 998 | | |
988 | 999 | | |
989 | 1000 | | |
990 | 1001 | | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
991 | 1011 | | |
992 | 1012 | | |
993 | 1013 | | |
| |||
0 commit comments