@@ -4779,7 +4779,7 @@ synthesizeBaseClassMethodBody(AbstractFunctionDecl *afd, void *context) {
4779
4779
for (auto param : *funcDecl->getParameters ()) {
4780
4780
auto paramRefExpr = new (ctx) DeclRefExpr (param, DeclNameLoc (),
4781
4781
/* Implicit=*/ true );
4782
- paramRefExpr->setType (param->getType ());
4782
+ paramRefExpr->setType (param->getTypeInContext ());
4783
4783
forwardingParams.push_back (paramRefExpr);
4784
4784
}
4785
4785
@@ -4791,7 +4791,7 @@ synthesizeBaseClassMethodBody(AbstractFunctionDecl *afd, void *context) {
4791
4791
auto *selfDecl = funcDecl->getImplicitSelfDecl ();
4792
4792
auto selfExpr = new (ctx) DeclRefExpr (selfDecl, DeclNameLoc (),
4793
4793
/* implicit*/ true );
4794
- selfExpr->setType (selfDecl->getType ());
4794
+ selfExpr->setType (selfDecl->getTypeInContext ());
4795
4795
4796
4796
auto staticCastRefExpr = getInteropStaticCastDeclRefExpr (
4797
4797
ctx, baseStruct->getClangDecl ()->getOwningModule (), baseType,
@@ -4845,7 +4845,7 @@ synthesizeBaseClassFieldGetterBody(AbstractFunctionDecl *afd, void *context) {
4845
4845
auto selfDecl = getterDecl->getImplicitSelfDecl ();
4846
4846
auto selfExpr = new (ctx) DeclRefExpr (selfDecl, DeclNameLoc (),
4847
4847
/* implicit*/ true );
4848
- selfExpr->setType (selfDecl->getType ());
4848
+ selfExpr->setType (selfDecl->getTypeInContext ());
4849
4849
4850
4850
auto staticCastRefExpr = getInteropStaticCastDeclRefExpr (
4851
4851
ctx, baseStruct->getClangDecl ()->getOwningModule (),
@@ -4863,7 +4863,7 @@ synthesizeBaseClassFieldGetterBody(AbstractFunctionDecl *afd, void *context) {
4863
4863
auto paramRefExpr = new (ctx) DeclRefExpr (paramDecl,
4864
4864
DeclNameLoc (),
4865
4865
/* Implicit=*/ true );
4866
- paramRefExpr->setType (paramDecl->getType ());
4866
+ paramRefExpr->setType (paramDecl->getTypeInContext ());
4867
4867
4868
4868
auto *argList = ArgumentList::forImplicitUnlabeled (ctx, {paramRefExpr});
4869
4869
baseMember = SubscriptExpr::create (ctx, casted, argList, subscript);
@@ -4878,7 +4878,7 @@ synthesizeBaseClassFieldGetterBody(AbstractFunctionDecl *afd, void *context) {
4878
4878
baseMember =
4879
4879
new (ctx) MemberRefExpr (casted, SourceLoc (), baseClassVar, DeclNameLoc (),
4880
4880
/* Implicit=*/ true , accessKind);
4881
- baseMember->setType (cast<VarDecl>(baseClassVar)->getType ());
4881
+ baseMember->setType (cast<VarDecl>(baseClassVar)->getTypeInContext ());
4882
4882
}
4883
4883
4884
4884
auto ret = new (ctx) ReturnStmt (SourceLoc (), baseMember);
@@ -4914,7 +4914,7 @@ synthesizeBaseClassFieldSetterBody(AbstractFunctionDecl *afd, void *context) {
4914
4914
auto paramRefExpr = new (ctx) DeclRefExpr (paramDecl,
4915
4915
DeclNameLoc (),
4916
4916
/* Implicit=*/ true );
4917
- paramRefExpr->setType (paramDecl->getType ());
4917
+ paramRefExpr->setType (paramDecl->getTypeInContext ());
4918
4918
4919
4919
auto *argList = ArgumentList::forImplicitUnlabeled (ctx, {paramRefExpr});
4920
4920
storedRef = SubscriptExpr::create (ctx, pointeePropertyRefExpr, argList, subscript);
@@ -4930,13 +4930,13 @@ synthesizeBaseClassFieldSetterBody(AbstractFunctionDecl *afd, void *context) {
4930
4930
storedRef =
4931
4931
new (ctx) MemberRefExpr (pointeePropertyRefExpr, SourceLoc (), baseClassVar,
4932
4932
DeclNameLoc (), /* Implicit=*/ true , accessKind);
4933
- storedRef->setType (LValueType::get (cast<VarDecl>(baseClassVar)->getType ()));
4933
+ storedRef->setType (LValueType::get (cast<VarDecl>(baseClassVar)->getTypeInContext ()));
4934
4934
}
4935
4935
4936
4936
auto newValueParamRefExpr =
4937
4937
new (ctx) DeclRefExpr (setterDecl->getParameters ()->get (0 ), DeclNameLoc (),
4938
4938
/* Implicit=*/ true );
4939
- newValueParamRefExpr->setType (setterDecl->getParameters ()->get (0 )->getType ());
4939
+ newValueParamRefExpr->setType (setterDecl->getParameters ()->get (0 )->getTypeInContext ());
4940
4940
4941
4941
auto assignExpr =
4942
4942
new (ctx) AssignExpr (storedRef, SourceLoc (), newValueParamRefExpr,
@@ -5998,14 +5998,15 @@ synthesizeDependentTypeThunkParamForwarding(AbstractFunctionDecl *afd, void *con
5998
5998
SmallVector<Argument, 8 > forwardingParams;
5999
5999
unsigned paramIndex = 0 ;
6000
6000
for (auto param : *thunkDecl->getParameters ()) {
6001
- if (isa<MetatypeType>(param->getType ().getPointer ())) {
6001
+ if (isa<MetatypeType>(param->getInterfaceType ().getPointer ())) {
6002
6002
paramIndex++;
6003
6003
continue ;
6004
6004
}
6005
- auto paramTy = param->getType ();
6005
+ auto paramTy = param->getTypeInContext ();
6006
6006
auto isInOut = param->isInOut ();
6007
6007
auto specParamTy =
6008
- specializedFuncDecl->getParameters ()->get (paramIndex)->getType ();
6008
+ specializedFuncDecl->getParameters ()->get (paramIndex)
6009
+ ->getTypeInContext ();
6009
6010
6010
6011
Expr *paramRefExpr = new (ctx) DeclRefExpr (param, DeclNameLoc (),
6011
6012
/* Implicit=*/ true );
@@ -6059,7 +6060,8 @@ synthesizeDependentTypeThunkParamForwarding(AbstractFunctionDecl *afd, void *con
6059
6060
specializedFuncCallExpr->setThrows (false );
6060
6061
6061
6062
Expr *resultExpr = nullptr ;
6062
- if (specializedFuncCallExpr->getType ()->isEqual (thunkDecl->getResultInterfaceType ())) {
6063
+ if (specializedFuncCallExpr->getType ()->isEqual (
6064
+ thunkDecl->getResultInterfaceType ())) {
6063
6065
resultExpr = specializedFuncCallExpr;
6064
6066
} else {
6065
6067
resultExpr = ForcedCheckedCastExpr::createImplicit (
@@ -6085,7 +6087,7 @@ static ValueDecl *addThunkForDependentTypes(FuncDecl *oldDecl,
6085
6087
for (auto *newFnParam : *newDecl->getParameters ()) {
6086
6088
// If the un-specialized function had a parameter with type "Any" preserve
6087
6089
// that parameter. Otherwise, use the new function parameter.
6088
- auto oldParamType = oldDecl->getParameters ()->get (parameterIndex)->getType ();
6090
+ auto oldParamType = oldDecl->getParameters ()->get (parameterIndex)->getInterfaceType ();
6089
6091
if (oldParamType->isEqual (newDecl->getASTContext ().getAnyExistentialType ())) {
6090
6092
updatedAnyParams = true ;
6091
6093
auto newParam =
@@ -6144,10 +6146,10 @@ synthesizeForwardingThunkBody(AbstractFunctionDecl *afd, void *context) {
6144
6146
6145
6147
SmallVector<Argument, 8 > forwardingParams;
6146
6148
for (auto param : *thunkDecl->getParameters ()) {
6147
- if (isa<MetatypeType>(param->getType ().getPointer ())) {
6149
+ if (isa<MetatypeType>(param->getInterfaceType ().getPointer ())) {
6148
6150
continue ;
6149
6151
}
6150
- auto paramTy = param->getType ();
6152
+ auto paramTy = param->getTypeInContext ();
6151
6153
auto isInOut = param->isInOut ();
6152
6154
6153
6155
Expr *paramRefExpr = new (ctx) DeclRefExpr (param, DeclNameLoc (),
0 commit comments