Commit 8e2f1c5
committed
[CSSimplify] Disfavor choices that have injected
Ambiguities like:
```
struct S {
init(v: Int) {}
init(v: Int, _: () -> Void) {}
func callAsFunction(_: () -> Void) {}
}
S(v: 42) {
}
```
Should always be resolved in favor of choice that doesn't require
injection of `.callAsFunction`, so let's try to avoid solving if
such an overload has already been found.
(cherry picked from commit 7898b5a)callAsFunction
1 parent c7e7e50 commit 8e2f1c5
File tree
2 files changed
+37
-0
lines changed- lib/Sema
- test/Constraints
2 files changed
+37
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11402 | 11402 | | |
11403 | 11403 | | |
11404 | 11404 | | |
| 11405 | + | |
11405 | 11406 | | |
11406 | 11407 | | |
11407 | 11408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments