@@ -72,13 +72,13 @@ class AnyFunctionRef {
72
72
CaptureInfo getCaptureInfo () const {
73
73
if (auto *AFD = TheFunction.dyn_cast <AbstractFunctionDecl *>())
74
74
return AFD->getCaptureInfo ();
75
- return TheFunction. get <AbstractClosureExpr *>()->getCaptureInfo ();
75
+ return cast <AbstractClosureExpr *>(TheFunction )->getCaptureInfo ();
76
76
}
77
77
78
78
ParameterList *getParameters () const {
79
79
if (auto *AFD = TheFunction.dyn_cast <AbstractFunctionDecl *>())
80
80
return AFD->getParameters ();
81
- return TheFunction. get <AbstractClosureExpr *>()->getParameters ();
81
+ return cast <AbstractClosureExpr *>(TheFunction )->getParameters ();
82
82
}
83
83
84
84
bool hasExternalPropertyWrapperParameters () const {
@@ -90,7 +90,7 @@ class AnyFunctionRef {
90
90
Type getType () const {
91
91
if (auto *AFD = TheFunction.dyn_cast <AbstractFunctionDecl *>())
92
92
return AFD->getInterfaceType ();
93
- return TheFunction. get <AbstractClosureExpr *>()->getType ();
93
+ return cast <AbstractClosureExpr *>(TheFunction )->getType ();
94
94
}
95
95
96
96
Type getBodyResultType () const {
@@ -99,7 +99,7 @@ class AnyFunctionRef {
99
99
return FD->mapTypeIntoContext (FD->getResultInterfaceType ());
100
100
return TupleType::getEmpty (AFD->getASTContext ());
101
101
}
102
- return TheFunction. get <AbstractClosureExpr *>()->getResultType ();
102
+ return cast <AbstractClosureExpr *>(TheFunction )->getResultType ();
103
103
}
104
104
105
105
ArrayRef<AnyFunctionType::Yield>
@@ -115,7 +115,7 @@ class AnyFunctionRef {
115
115
BraceStmt *getBody () const {
116
116
if (auto *AFD = TheFunction.dyn_cast <AbstractFunctionDecl *>())
117
117
return AFD->getBody ();
118
- auto *ACE = TheFunction. get <AbstractClosureExpr *>();
118
+ auto *ACE = cast <AbstractClosureExpr *>(TheFunction );
119
119
if (auto *CE = dyn_cast<ClosureExpr>(ACE))
120
120
return CE->getBody ();
121
121
return cast<AutoClosureExpr>(ACE)->getBody ();
@@ -127,7 +127,7 @@ class AnyFunctionRef {
127
127
return ;
128
128
}
129
129
130
- auto *ACE = TheFunction. get <AbstractClosureExpr *>();
130
+ auto *ACE = cast <AbstractClosureExpr *>(TheFunction );
131
131
if (auto *CE = dyn_cast<ClosureExpr>(ACE)) {
132
132
CE->setBody (stmt);
133
133
CE->setBodyState (ClosureExpr::BodyState::Parsed);
@@ -143,7 +143,7 @@ class AnyFunctionRef {
143
143
return ;
144
144
}
145
145
146
- auto *ACE = TheFunction. get <AbstractClosureExpr *>();
146
+ auto *ACE = cast <AbstractClosureExpr *>(TheFunction );
147
147
if (auto *CE = dyn_cast<ClosureExpr>(ACE)) {
148
148
CE->setBody (stmt);
149
149
CE->setBodyState (ClosureExpr::BodyState::TypeChecked);
@@ -168,7 +168,7 @@ class AnyFunctionRef {
168
168
DeclContext *getAsDeclContext () const {
169
169
if (auto *AFD = TheFunction.dyn_cast <AbstractFunctionDecl *>())
170
170
return AFD;
171
- return TheFunction. get <AbstractClosureExpr *>();
171
+ return cast <AbstractClosureExpr *>(TheFunction );
172
172
}
173
173
174
174
AbstractFunctionDecl *getAbstractFunctionDecl () const {
0 commit comments