Commit bee299e
committed
wildApprox: also approximate FunProto arguments
Previously, `wildApprox` delegated FunProto handling to
`TypeMap#mapOver` which only maps the result type of the FunProto, but
the result of `wildApprox` can be passed to
`ImplicitRunInfo#computeIScope` which will end up calling
`FunProto#typedArgs`. This caused two problems:
- It forced us to use a `provisional` flag in `computeIScope` to account
for uninstantiated type variables that might show up in the result of
typedArgs.
- It lead to an assertion failure (in i13340.scala) because it turns out
that `typedArgs` doesn't always respect the pre-conditions of
`mergeConstraintWith` (see added NOTE).
By approximating FunProto arguments in wildApprox we can drop the
`provisional` flag and avoid the issue with `typedArgs` (though we might
need to actually fix `typedArgs` one day if the same issue shows up in
other circumstances).
Fixes #13340.1 parent 5eff3d0 commit bee299e
File tree
3 files changed
+22
-8
lines changed- compiler/src/dotty/tools/dotc/typer
- tests/neg
3 files changed
+22
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
566 | 565 | | |
567 | 566 | | |
568 | 567 | | |
| |||
587 | 586 | | |
588 | 587 | | |
589 | 588 | | |
| 589 | + | |
590 | 590 | | |
591 | | - | |
592 | 591 | | |
593 | 592 | | |
594 | 593 | | |
595 | 594 | | |
596 | 595 | | |
597 | | - | |
598 | | - | |
| 596 | + | |
599 | 597 | | |
600 | 598 | | |
601 | 599 | | |
602 | | - | |
| 600 | + | |
603 | 601 | | |
604 | 602 | | |
605 | 603 | | |
| |||
674 | 672 | | |
675 | 673 | | |
676 | 674 | | |
677 | | - | |
| 675 | + | |
678 | 676 | | |
679 | 677 | | |
680 | 678 | | |
681 | 679 | | |
682 | | - | |
683 | 680 | | |
684 | 681 | | |
685 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
398 | 401 | | |
399 | 402 | | |
400 | 403 | | |
| |||
822 | 825 | | |
823 | 826 | | |
824 | 827 | | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
825 | 839 | | |
826 | 840 | | |
827 | 841 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments