File tree Expand file tree Collapse file tree 2 files changed +0
-22
lines changed Expand file tree Collapse file tree 2 files changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -7220,7 +7220,6 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
72207220 }
72217221
72227222 Expr *getSingleExpressionBody () const ;
7223- void setSingleExpressionBody (Expr *NewBody);
72247223
72257224 // / Returns the string for the base name, or "_" if this is unnamed.
72267225 StringRef getNameStr () const {
Original file line number Diff line number Diff line change @@ -1029,27 +1029,6 @@ Expr *AbstractFunctionDecl::getSingleExpressionBody() const {
10291029 return body.get <Expr *>();
10301030}
10311031
1032- void AbstractFunctionDecl::setSingleExpressionBody (Expr *NewBody) {
1033- assert (hasSingleExpressionBody () && " Not a single-expression body" );
1034- auto body = getBody (/* canSynthesize=*/ false )->getLastElement ();
1035- if (auto *stmt = body.dyn_cast <Stmt *>()) {
1036- if (auto *returnStmt = dyn_cast<ReturnStmt>(stmt)) {
1037- returnStmt->setResult (NewBody);
1038- return ;
1039- } else if (isa<FailStmt>(stmt)) {
1040- // We can only get to this point if we're a type-checked ConstructorDecl
1041- // which was originally spelled init?(...) { nil }.
1042- //
1043- // We can no longer write the single-expression which is being set on us
1044- // into anything because a FailStmt does not have such a child. As a
1045- // result we need to demand that the NewBody is null.
1046- assert (NewBody == nullptr );
1047- return ;
1048- }
1049- }
1050- getBody ()->setLastElement (NewBody);
1051- }
1052-
10531032bool AbstractStorageDecl::isCompileTimeConst () const {
10541033 return getAttrs ().hasAttribute <CompileTimeConstAttr>();
10551034}
You can’t perform that action at this time.
0 commit comments