mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SILGen] Correctly determine the thrown error type for closures
When a closure throws a generic error type, we were retrieving the substituted error type (involving archetypes) when we needed to be working with the interface type. Fixes rdar://124484012.
This commit is contained in:
@@ -1537,6 +1537,11 @@ public:
|
||||
std::optional<std::pair<AbstractionPattern, CanType>>
|
||||
getFunctionThrownErrorType(CanAnyFunctionType substFnInterfaceType) const;
|
||||
|
||||
/// For the abstraction pattern produced by `getFunctionThrownErrorType()`,
|
||||
/// produce the effective thrown error type to be used when we don't have
|
||||
/// a substituted error type.
|
||||
CanType getEffectiveThrownErrorType() const;
|
||||
|
||||
/// Given that the value being abstracted is a function type, return
|
||||
/// the abstraction pattern for one of its parameter types.
|
||||
AbstractionPattern getFunctionParamType(unsigned index) const;
|
||||
|
||||
Reference in New Issue
Block a user