mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Typed throws] Type system support for typed throws.
Add the thrown type into the AST representation of function types, mapping from function type representations and declarations into the appropriate thrown type. Add tests for serialization, printing, and basic equivalence of function types that have thrown errors.
This commit is contained in:
@@ -5344,6 +5344,7 @@ public:
|
||||
fnTy->isSendable(),
|
||||
fnTy->isAsync(),
|
||||
fnTy->isThrowing(),
|
||||
S.addTypeRef(fnTy->getThrownError()),
|
||||
getRawStableDifferentiabilityKind(fnTy->getDifferentiabilityKind()),
|
||||
globalActor);
|
||||
|
||||
@@ -5359,6 +5360,7 @@ public:
|
||||
S.addTypeRef(fnTy->getResult()),
|
||||
getRawStableFunctionTypeRepresentation(fnTy->getRepresentation()),
|
||||
fnTy->isSendable(), fnTy->isAsync(), fnTy->isThrowing(),
|
||||
S.addTypeRef(fnTy->getThrownError()),
|
||||
getRawStableDifferentiabilityKind(fnTy->getDifferentiabilityKind()),
|
||||
S.addTypeRef(fnTy->getGlobalActor()),
|
||||
S.addGenericSignatureRef(genericSig));
|
||||
|
||||
Reference in New Issue
Block a user