Commit 5dfc6b8
committed
Ignore async/sync mismatch on main
The main function is different from other function resolutions. It isn't
being called from a synchronous or asynchronous context, but defines
whether the program starts in a synchronous or async context. As a
result, we should not prefer one over the other, so the scoring
mechanism shouldn't involve the async/sync score when resolving the main
function.
This patch adds a constraint solver flag to ignore async/sync context
mismatches so that we do not favor one over the other, but otherwise use
the normal resolution behavior.1 parent 94e30a8 commit 5dfc6b8
File tree
3 files changed
+7
-2
lines changed- include/swift/Sema
- lib/Sema
3 files changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1559 | 1559 | | |
1560 | 1560 | | |
1561 | 1561 | | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
1562 | 1565 | | |
1563 | 1566 | | |
1564 | 1567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3304 | 3304 | | |
3305 | 3305 | | |
3306 | 3306 | | |
3307 | | - | |
| 3307 | + | |
| 3308 | + | |
3308 | 3309 | | |
3309 | 3310 | | |
3310 | 3311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2172 | 2172 | | |
2173 | 2173 | | |
2174 | 2174 | | |
2175 | | - | |
| 2175 | + | |
| 2176 | + | |
2176 | 2177 | | |
2177 | 2178 | | |
2178 | 2179 | | |
| |||
0 commit comments