Don't walk into an as-of-yet-unsynthesized function body.

...and don't dump it, and don't force it just to see if an accessor is present.

Swift SVN r15830
This commit is contained in:
Jordan Rose
2014-04-02 21:00:48 +00:00
parent 63c1ef7ae4
commit 0324b9e027
4 changed files with 5 additions and 5 deletions

View File

@@ -3233,8 +3233,8 @@ public:
/// have a body for this function.
///
/// \sa hasBody()
BraceStmt *getBody() const {
if (getBodyKind() == BodyKind::Synthesize) {
BraceStmt *getBody(bool canSynthesize = true) const {
if (canSynthesize && getBodyKind() == BodyKind::Synthesize) {
const_cast<AbstractFunctionDecl *>(this)->setBodyKind(BodyKind::None);
(*Synthesizer)(const_cast<AbstractFunctionDecl *>(this));
}