mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Handle computed properties with a getter /and/ setter.
Since accessor FuncDecl have a backreference to the VarDecl they are attached to, we were getting re-entrant deserialization issues. Fix this by just not serializing the backreference and relying on the property being deserialized first. Swift SVN r6134
This commit is contained in:
@@ -735,24 +735,8 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext) {
|
||||
else if (isa<PostfixOperatorDecl>(op))
|
||||
attrs.ExplicitPostfix = true;
|
||||
// Note that an explicit [infix] is not required.
|
||||
} else {
|
||||
bool isGetter = false;
|
||||
|
||||
if (auto subscript = dyn_cast<SubscriptDecl>(associated)) {
|
||||
isGetter = (subscript->getGetter() == fn);
|
||||
assert(isGetter || subscript->getSetter() == fn);
|
||||
} else if (auto var = dyn_cast<VarDecl>(associated)) {
|
||||
isGetter = (var->getGetter() == fn);
|
||||
assert(isGetter || var->getSetter() == fn);
|
||||
} else {
|
||||
llvm_unreachable("unknown associated decl kind");
|
||||
}
|
||||
|
||||
if (isGetter)
|
||||
fn->makeGetter(associated);
|
||||
else
|
||||
fn->makeSetter(associated);
|
||||
}
|
||||
// Otherwise, unknown associated decl kind.
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user