mirror of
https://github.com/apple/swift.git
synced 2026-03-04 18:24:35 +01:00
Sometimes, as an optimization, we fulfill a function conversion
expression that wraps a closure literal by adjusting the emission of the
closure function instead of emitting a thunk. For example, the following
closure is emitted as an untyped throws function, and the errors thrown
in its body are type-erased:
```swift
func foo<E: Error>(e: E) {
let _: () throws -> Void = { () throws(E) -> Void in
throw e
}
}
```
Be careful not to rely on the thrown error type stored in the AST node,
since it may differ from the effective thrown error type tracked by
SILGen.
Fixes rdar://169150387.
81 KiB
81 KiB