Files
swift-mirror/lib/Sema/CSSimplify.cpp
Pavel Yaskevich ace4d3ac5e [ConstraintSystem] Detect passing sync closure to async argument early
This helps in situations where there are multiple overloads which
differ only in async effect of their parameters. Passing sync argument
to a sync parameter is always preferred and when detected early
allows solver to avoid some of the duplicate work re-solving for
the rest of the path e.g.

```swift
func test<T>(_: () -> T) {}
func test<T>(_: () async -> T) {}

test {
  // sync work
}.op(...)
```

In this case since closure is synchronous first overload of `test`
is always preferred (when it's a match) and solver can skip re-checking
body of the closure and `op` call when it encounters `async` version.

Resolves: rdar://77942193
2021-05-14 13:49:39 -07:00

464 KiB