AST: Use AbstractFunctionDecl::computeType()

This commit is contained in:
Slava Pestov
2018-07-21 05:16:30 -07:00
parent f6b96da3e2
commit 106878005e
2 changed files with 26 additions and 76 deletions

View File

@@ -3006,18 +3006,7 @@ void ClassDecl::addImplicitDestructor() {
recordObjCMethod(DD);
// Assign DD the interface type (Self) -> () -> ()
ArrayRef<AnyFunctionType::Param> noParams;
AnyFunctionType::ExtInfo info;
Type selfTy = selfDecl->getInterfaceType();
Type voidTy = TupleType::getEmpty(ctx);
Type funcTy = FunctionType::get(noParams, voidTy, info);
if (auto *sig = DD->getGenericSignature()) {
DD->setInterfaceType(
GenericFunctionType::get(sig, {selfTy}, funcTy, info));
} else {
DD->setInterfaceType(
FunctionType::get({selfTy}, funcTy, info));
}
DD->computeType();
}