Commit 12d8609
fix: handle for/while ElseBody in generator traversals and remove stale symbol fallback
- ContainsYield() now checks ForStatement.ElseBody and WhileStatement.ElseBody,
ensuring yield in for/while else blocks correctly marks the function as a generator.
- FindReturnWithValue() now checks ForStatement.ElseBody and WhileStatement.ElseBody,
ensuring return-with-value in those blocks triggers SPY0267.
- Removed stale functionSymbol fallback in generator symbol update path; replaced
with Debug.Assert + null guard to surface bugs instead of silently succeeding.
- Removed redundant Shared. namespace qualifier in DunderDetector call.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent c71112f commit 12d8609
2 files changed
Lines changed: 29 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
387 | 388 | | |
388 | 389 | | |
389 | 390 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
401 | 394 | | |
402 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
403 | 404 | | |
404 | | - | |
405 | | - | |
406 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| |||
793 | 797 | | |
794 | 798 | | |
795 | 799 | | |
| 800 | + | |
| 801 | + | |
796 | 802 | | |
797 | 803 | | |
798 | 804 | | |
799 | 805 | | |
800 | 806 | | |
| 807 | + | |
| 808 | + | |
801 | 809 | | |
802 | 810 | | |
803 | 811 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
153 | 159 | | |
154 | 160 | | |
155 | 161 | | |
| |||
0 commit comments