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 {
7220
7220
}
7221
7221
7222
7222
Expr *getSingleExpressionBody () const ;
7223
- void setSingleExpressionBody (Expr *NewBody);
7224
7223
7225
7224
// / Returns the string for the base name, or "_" if this is unnamed.
7226
7225
StringRef getNameStr () const {
Original file line number Diff line number Diff line change @@ -1029,27 +1029,6 @@ Expr *AbstractFunctionDecl::getSingleExpressionBody() const {
1029
1029
return body.get <Expr *>();
1030
1030
}
1031
1031
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
-
1053
1032
bool AbstractStorageDecl::isCompileTimeConst () const {
1054
1033
return getAttrs ().hasAttribute <CompileTimeConstAttr>();
1055
1034
}
You can’t perform that action at this time.
0 commit comments