swift
6c960a6f - Merge pull request #87895 from MaxDesiatov/maxd/typed-throws-fix

Commit
41 days ago
Merge pull request #87895 from MaxDesiatov/maxd/typed-throws-fix **Explanation**: When a static method with typed throws is passed as a function reference to a generic parameter expecting untyped throws, `canEmitSpecializedClosureFunction` allows emitting the closure directly under the conversion. The fix rejects the optimization whenever the closure's thrown error type differs from the destination's, forcing a thunk instead. Resolves https://github.com/swiftlang/swift/issues/87893 compiler crash. **Scope**: limited to code with typed throws. **Risk**: low due to extensive test suite passing (ran `@swift-ci test` here as opposed to `@swift-ci smoke test`) and new test coverage added **Testing**: lit test suite expanded in this PR to cover the regression. **Issue**: rdar://172703741 **Reviewer**: @DougGregor
Author
Loading