@@ -838,7 +838,7 @@ makeIndirectFieldAccessors(ClangImporter::Implementation &Impl,
838
838
lhs = new (C) MemberRefExpr (lhs, SourceLoc (), anonymousInnerFieldDecl,
839
839
DeclNameLoc (), /* implicit*/ true );
840
840
841
- auto newValueDecl = setterDecl->getParameterList ( 1 )->get (0 );
841
+ auto newValueDecl = setterDecl->getParameters ( )->get (0 );
842
842
843
843
auto rhs = new (C) DeclRefExpr (newValueDecl, DeclNameLoc (),
844
844
/* implicit*/ true );
@@ -922,7 +922,7 @@ makeUnionFieldAccessors(ClangImporter::Implementation &Impl,
922
922
auto inoutSelf = new (C) InOutExpr (SourceLoc (), inoutSelfRef,
923
923
importedUnionDecl->getDeclaredType (), /* implicit*/ true );
924
924
925
- auto newValueDecl = setterDecl->getParameterList ( 1 )->get (0 );
925
+ auto newValueDecl = setterDecl->getParameters ( )->get (0 );
926
926
927
927
auto newValueRef = new (C) DeclRefExpr (newValueDecl, DeclNameLoc (),
928
928
/* implicit*/ true );
@@ -1463,8 +1463,7 @@ static ConstructorDecl *createRawValueBridgingConstructor(
1463
1463
/* wantBody=*/ false );
1464
1464
// Insert our custom init body
1465
1465
if (wantBody) {
1466
- auto selfDecl = init->getParameterList (0 )->get (0 );
1467
-
1466
+ auto selfDecl = init->getImplicitSelfDecl ();
1468
1467
auto storedType = storedRawValue->getInterfaceType ();
1469
1468
1470
1469
// Construct left-hand side.
@@ -1479,7 +1478,7 @@ static ConstructorDecl *createRawValueBridgingConstructor(
1479
1478
1480
1479
// Construct right-hand side.
1481
1480
// FIXME: get the parameter from the init, and plug it in here.
1482
- auto *paramDecl = init->getParameterList ( 1 )->get (0 );
1481
+ auto *paramDecl = init->getParameters ( )->get (0 );
1483
1482
auto *paramRef = new (ctx) DeclRefExpr (
1484
1483
paramDecl, DeclNameLoc (), /* Implicit=*/ true );
1485
1484
paramRef->setType (paramDecl->getType ());
@@ -1672,7 +1671,7 @@ buildSubscriptSetterDecl(ClangImporter::Implementation &Impl,
1672
1671
//
1673
1672
// Build a setter thunk with the latter signature that maps to the
1674
1673
// former.
1675
- auto valueIndex = setter->getParameterList ( 1 );
1674
+ auto valueIndex = setter->getParameters ( );
1676
1675
1677
1676
// 'self'
1678
1677
auto selfDecl = ParamDecl::createSelf (SourceLoc (), dc);
@@ -1728,7 +1727,7 @@ buildSubscriptSetterDecl(ClangImporter::Implementation &Impl,
1728
1727
// / Retrieve the element interface type and key param decl of a subscript
1729
1728
// / setter.
1730
1729
static std::pair<Type, ParamDecl *> decomposeSubscriptSetter (FuncDecl *setter) {
1731
- auto *PL = setter->getParameterList ( 1 );
1730
+ auto *PL = setter->getParameters ( );
1732
1731
if (PL->size () != 2 )
1733
1732
return {nullptr , nullptr };
1734
1733
@@ -4810,8 +4809,8 @@ namespace {
4810
4809
// different (usually in something like nullability), but for Swift it's
4811
4810
// an AST invariant that's assumed and asserted elsewhere. If the type is
4812
4811
// different, just drop the setter, and leave the property as get-only.
4813
- assert (setter->getParameterLists (). back ()->size () == 1 );
4814
- const ParamDecl *param = setter->getParameterLists (). back ()->get (0 );
4812
+ assert (setter->getParameters ()->size () == 1 );
4813
+ const ParamDecl *param = setter->getParameters ()->get (0 );
4815
4814
if (!param->getInterfaceType ()->isEqual (original->getInterfaceType ()))
4816
4815
return ;
4817
4816
@@ -6621,7 +6620,7 @@ SwiftDeclConverter::importSubscript(Decl *decl,
6621
6620
// Find the getter indices and make sure they match.
6622
6621
ParamDecl *getterIndex;
6623
6622
{
6624
- auto params = getter->getParameterList ( 1 );
6623
+ auto params = getter->getParameters ( );
6625
6624
if (params->size () != 1 )
6626
6625
return nullptr ;
6627
6626
getterIndex = params->get (0 );
@@ -6630,11 +6629,7 @@ SwiftDeclConverter::importSubscript(Decl *decl,
6630
6629
// Compute the element type based on the getter, looking through
6631
6630
// the implicit 'self' parameter and the normal function
6632
6631
// parameters.
6633
- auto elementTy = getter->getInterfaceType ()
6634
- ->castTo <AnyFunctionType>()
6635
- ->getResult ()
6636
- ->castTo <AnyFunctionType>()
6637
- ->getResult ();
6632
+ auto elementTy = getter->getResultInterfaceType ();
6638
6633
auto elementContextTy = getter->mapTypeIntoContext (elementTy);
6639
6634
6640
6635
// Local function to mark the setter unavailable.
0 commit comments