Commit aaef434
Fix non-converging generic parameter inference loop (review doc A3) (#216)
Two defects fed each other in resolveGenericParamsFromFunctionCall:
- optional/multi-args params past the call operands were counted as
progress every round without being marked processed, inflating
totalProcessed past the == termination check - the origin of the
"loop detected" +100 guard. They are now marked processed and
counted once.
- that double-counting was also load-bearing: for signatures like
reduce2<T, V = T>(..., initial?: V) a callback param typed by a
defaulted type param can never resolve inside the loop (defaults zip
after it), and only the inflated count let the loop exit. A
no-progress round now breaks out instead of erroring, letting the
default zipping and the existing completeness check decide.
The +100 guard is now defensive-only (each param counted at most once).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent de6b8ca commit aaef434
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2577 | 2577 | | |
2578 | 2578 | | |
2579 | 2579 | | |
2580 | | - | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
2581 | 2583 | | |
2582 | 2584 | | |
| 2585 | + | |
2583 | 2586 | | |
2584 | 2587 | | |
2585 | 2588 | | |
2586 | 2589 | | |
2587 | 2590 | | |
2588 | 2591 | | |
| 2592 | + | |
2589 | 2593 | | |
2590 | 2594 | | |
2591 | 2595 | | |
| |||
2640 | 2644 | | |
2641 | 2645 | | |
2642 | 2646 | | |
2643 | | - | |
2644 | | - | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
2645 | 2652 | | |
2646 | 2653 | | |
2647 | 2654 | | |
| |||
2653 | 2660 | | |
2654 | 2661 | | |
2655 | 2662 | | |
2656 | | - | |
| 2663 | + | |
2657 | 2664 | | |
2658 | 2665 | | |
2659 | 2666 | | |
| |||
0 commit comments