@@ -4779,7 +4779,7 @@ synthesizeBaseClassMethodBody(AbstractFunctionDecl *afd, void *context) {
47794779 for (auto param : *funcDecl->getParameters ()) {
47804780 auto paramRefExpr = new (ctx) DeclRefExpr (param, DeclNameLoc (),
47814781 /* Implicit=*/ true );
4782- paramRefExpr->setType (param->getType ());
4782+ paramRefExpr->setType (param->getTypeInContext ());
47834783 forwardingParams.push_back (paramRefExpr);
47844784 }
47854785
@@ -4791,7 +4791,7 @@ synthesizeBaseClassMethodBody(AbstractFunctionDecl *afd, void *context) {
47914791 auto *selfDecl = funcDecl->getImplicitSelfDecl ();
47924792 auto selfExpr = new (ctx) DeclRefExpr (selfDecl, DeclNameLoc (),
47934793 /* implicit*/ true );
4794- selfExpr->setType (selfDecl->getType ());
4794+ selfExpr->setType (selfDecl->getTypeInContext ());
47954795
47964796 auto staticCastRefExpr = getInteropStaticCastDeclRefExpr (
47974797 ctx, baseStruct->getClangDecl ()->getOwningModule (), baseType,
@@ -4845,7 +4845,7 @@ synthesizeBaseClassFieldGetterBody(AbstractFunctionDecl *afd, void *context) {
48454845 auto selfDecl = getterDecl->getImplicitSelfDecl ();
48464846 auto selfExpr = new (ctx) DeclRefExpr (selfDecl, DeclNameLoc (),
48474847 /* implicit*/ true );
4848- selfExpr->setType (selfDecl->getType ());
4848+ selfExpr->setType (selfDecl->getTypeInContext ());
48494849
48504850 auto staticCastRefExpr = getInteropStaticCastDeclRefExpr (
48514851 ctx, baseStruct->getClangDecl ()->getOwningModule (),
@@ -4863,7 +4863,7 @@ synthesizeBaseClassFieldGetterBody(AbstractFunctionDecl *afd, void *context) {
48634863 auto paramRefExpr = new (ctx) DeclRefExpr (paramDecl,
48644864 DeclNameLoc (),
48654865 /* Implicit=*/ true );
4866- paramRefExpr->setType (paramDecl->getType ());
4866+ paramRefExpr->setType (paramDecl->getTypeInContext ());
48674867
48684868 auto *argList = ArgumentList::forImplicitUnlabeled (ctx, {paramRefExpr});
48694869 baseMember = SubscriptExpr::create (ctx, casted, argList, subscript);
@@ -4878,7 +4878,7 @@ synthesizeBaseClassFieldGetterBody(AbstractFunctionDecl *afd, void *context) {
48784878 baseMember =
48794879 new (ctx) MemberRefExpr (casted, SourceLoc (), baseClassVar, DeclNameLoc (),
48804880 /* Implicit=*/ true , accessKind);
4881- baseMember->setType (cast<VarDecl>(baseClassVar)->getType ());
4881+ baseMember->setType (cast<VarDecl>(baseClassVar)->getTypeInContext ());
48824882 }
48834883
48844884 auto ret = new (ctx) ReturnStmt (SourceLoc (), baseMember);
@@ -4914,7 +4914,7 @@ synthesizeBaseClassFieldSetterBody(AbstractFunctionDecl *afd, void *context) {
49144914 auto paramRefExpr = new (ctx) DeclRefExpr (paramDecl,
49154915 DeclNameLoc (),
49164916 /* Implicit=*/ true );
4917- paramRefExpr->setType (paramDecl->getType ());
4917+ paramRefExpr->setType (paramDecl->getTypeInContext ());
49184918
49194919 auto *argList = ArgumentList::forImplicitUnlabeled (ctx, {paramRefExpr});
49204920 storedRef = SubscriptExpr::create (ctx, pointeePropertyRefExpr, argList, subscript);
@@ -4930,13 +4930,13 @@ synthesizeBaseClassFieldSetterBody(AbstractFunctionDecl *afd, void *context) {
49304930 storedRef =
49314931 new (ctx) MemberRefExpr (pointeePropertyRefExpr, SourceLoc (), baseClassVar,
49324932 DeclNameLoc (), /* Implicit=*/ true , accessKind);
4933- storedRef->setType (LValueType::get (cast<VarDecl>(baseClassVar)->getType ()));
4933+ storedRef->setType (LValueType::get (cast<VarDecl>(baseClassVar)->getTypeInContext ()));
49344934 }
49354935
49364936 auto newValueParamRefExpr =
49374937 new (ctx) DeclRefExpr (setterDecl->getParameters ()->get (0 ), DeclNameLoc (),
49384938 /* Implicit=*/ true );
4939- newValueParamRefExpr->setType (setterDecl->getParameters ()->get (0 )->getType ());
4939+ newValueParamRefExpr->setType (setterDecl->getParameters ()->get (0 )->getTypeInContext ());
49404940
49414941 auto assignExpr =
49424942 new (ctx) AssignExpr (storedRef, SourceLoc (), newValueParamRefExpr,
@@ -5998,14 +5998,15 @@ synthesizeDependentTypeThunkParamForwarding(AbstractFunctionDecl *afd, void *con
59985998 SmallVector<Argument, 8 > forwardingParams;
59995999 unsigned paramIndex = 0 ;
60006000 for (auto param : *thunkDecl->getParameters ()) {
6001- if (isa<MetatypeType>(param->getType ().getPointer ())) {
6001+ if (isa<MetatypeType>(param->getInterfaceType ().getPointer ())) {
60026002 paramIndex++;
60036003 continue ;
60046004 }
6005- auto paramTy = param->getType ();
6005+ auto paramTy = param->getTypeInContext ();
60066006 auto isInOut = param->isInOut ();
60076007 auto specParamTy =
6008- specializedFuncDecl->getParameters ()->get (paramIndex)->getType ();
6008+ specializedFuncDecl->getParameters ()->get (paramIndex)
6009+ ->getTypeInContext ();
60096010
60106011 Expr *paramRefExpr = new (ctx) DeclRefExpr (param, DeclNameLoc (),
60116012 /* Implicit=*/ true );
@@ -6059,7 +6060,8 @@ synthesizeDependentTypeThunkParamForwarding(AbstractFunctionDecl *afd, void *con
60596060 specializedFuncCallExpr->setThrows (false );
60606061
60616062 Expr *resultExpr = nullptr ;
6062- if (specializedFuncCallExpr->getType ()->isEqual (thunkDecl->getResultInterfaceType ())) {
6063+ if (specializedFuncCallExpr->getType ()->isEqual (
6064+ thunkDecl->getResultInterfaceType ())) {
60636065 resultExpr = specializedFuncCallExpr;
60646066 } else {
60656067 resultExpr = ForcedCheckedCastExpr::createImplicit (
@@ -6085,7 +6087,7 @@ static ValueDecl *addThunkForDependentTypes(FuncDecl *oldDecl,
60856087 for (auto *newFnParam : *newDecl->getParameters ()) {
60866088 // If the un-specialized function had a parameter with type "Any" preserve
60876089 // that parameter. Otherwise, use the new function parameter.
6088- auto oldParamType = oldDecl->getParameters ()->get (parameterIndex)->getType ();
6090+ auto oldParamType = oldDecl->getParameters ()->get (parameterIndex)->getInterfaceType ();
60896091 if (oldParamType->isEqual (newDecl->getASTContext ().getAnyExistentialType ())) {
60906092 updatedAnyParams = true ;
60916093 auto newParam =
@@ -6144,10 +6146,10 @@ synthesizeForwardingThunkBody(AbstractFunctionDecl *afd, void *context) {
61446146
61456147 SmallVector<Argument, 8 > forwardingParams;
61466148 for (auto param : *thunkDecl->getParameters ()) {
6147- if (isa<MetatypeType>(param->getType ().getPointer ())) {
6149+ if (isa<MetatypeType>(param->getInterfaceType ().getPointer ())) {
61486150 continue ;
61496151 }
6150- auto paramTy = param->getType ();
6152+ auto paramTy = param->getTypeInContext ();
61516153 auto isInOut = param->isInOut ();
61526154
61536155 Expr *paramRefExpr = new (ctx) DeclRefExpr (param, DeclNameLoc (),
0 commit comments