mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Part of the fix for rdar://problem/18677108 (tests and more changes go to SourceKit). The swift’s part handles the cases when an implicit accessor was created, but its body is not synthesized; e.g. in case the owning PatternBindingDecl is invalid.
Swift SVN r23037
This commit is contained in:
@@ -162,7 +162,12 @@ bool SemaAnnotator::walkToDeclPost(Decl *D) {
|
||||
if (VD->getAttrs().hasAttribute<LazyAttr>()) {
|
||||
if (auto *Get = VD->getGetter()) {
|
||||
assert(Get->isImplicit() && "lazy var not implicitly computed");
|
||||
Get->getBody()->walk(*this);
|
||||
|
||||
// Note that an implicit getter may not have the body synthesized
|
||||
// in case the owning PatternBindingDecl is invalid
|
||||
if(auto *Body = Get->getBody()) {
|
||||
Body->walk(*this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user