Files
Slava Pestov f932ef4db9 SIL: Fix bug in AbstractionPattern::getFunctionThrownErrorType()
When storing a closure with type `() throws(any Error) -> ()` as
a fully opaque error, we want to leave it unchanged, instead of
re-abstracting it to throw the error indirectly. Thus, we had
a special carveout here.

However, the carveout was too broad, because if the thrown error
type contained type parameters, the resulting AbstractionPattern
was invalid.

While fixing this I realized this entire hack is unsound in some
cases, if you view the same value as a `() throws(U) -> ()` vs
an `() -> throws(any Error) -> ()`.

Perhaps we should always box the thrown error when maximally
abstracting a closure, but that would also be an ABI break.

- Fixes https://github.com/swiftlang/swift/issues/84051
2025-10-10 17:46:22 +01:00
..