Commit 6ebb4c2
committed
Fallback to alts before skipParamClause if empty in resolveCandidates
`resolvedMapped` applies `resolveOverloaded(resolve)`, _not_ `resolve` directly.
This benefits from the insertion of implicit parameters, apply methods, etc.
But there are still some adaptations, e.g. auto-tupling, that are not performed
at this stage. In those cases, it is possible that we find that no alternatives
are applicable. So we fallback to the `alts` we had before considering the next
parameter clause. Resolution will succeed (only) if narrowMostSpecific finds an
unambiguous alternative by considering (only) the prior argument lists, after
which adaptation can be performed.
See tests/run/tupled-function-extension-method.scala for an example.
We only do this for resolveCandidates and not resolveOverloaded2, because
in the latter causes some cases where there are indeed no good alternatives
to be reported as ambiguous instead, which is unideal for error messages.1 parent fab9bbf commit 6ebb4c2
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2228 | 2228 | | |
2229 | 2229 | | |
2230 | 2230 | | |
2231 | | - | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
2232 | 2234 | | |
2233 | 2235 | | |
2234 | 2236 | | |
| |||
2287 | 2289 | | |
2288 | 2290 | | |
2289 | 2291 | | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
2290 | 2301 | | |
2291 | 2302 | | |
2292 | 2303 | | |
| |||
2405 | 2416 | | |
2406 | 2417 | | |
2407 | 2418 | | |
| 2419 | + | |
2408 | 2420 | | |
2409 | 2421 | | |
2410 | 2422 | | |
| |||
0 commit comments