Commit 6805c39
committed
Fix #7082: Refine overloading resolution with default arguments
We previously had a fallback to pick methods without default arguments
over methods with default arguments as a final tie breaker. (Rolling the
distinction into the specificity test was tried previously, but without
success). The fallback only worked if there was a single alternative
without default arguments. This is now generalized to the case where
there are several such alternatives.
Also, we now avoid mentioning inapplicable alternatives in overloading
ambiguity error messages.1 parent 840a122 commit 6805c39
File tree
2 files changed
+17
-2
lines changed- compiler/src/dotty/tools/dotc/typer
- tests/pos
2 files changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1721 | 1721 | | |
1722 | 1722 | | |
1723 | 1723 | | |
1724 | | - | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
1725 | 1729 | | |
1726 | 1730 | | |
1727 | 1731 | | |
1728 | | - | |
| 1732 | + | |
1729 | 1733 | | |
1730 | 1734 | | |
1731 | 1735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments