@@ -1146,15 +1146,14 @@ static SDKNode *constructTypeNode(SDKContext &Ctx, Type T) {
1146
1146
// We sometimes skip the first parameter because it can be metatype of dynamic
1147
1147
// this if the function is a member function.
1148
1148
static SDKNode *constructFunctionNode (SDKContext &Ctx, FuncDecl* FD,
1149
- SDKNodeKind Kind, bool SkipFirst ) {
1149
+ SDKNodeKind Kind) {
1150
1150
auto Func = SDKNodeInitInfo (Ctx, FD).createSDKNode (Kind);
1151
1151
Func->addChild (constructTypeNode (Ctx, FD->getResultInterfaceType ()));
1152
1152
for (auto *paramList : FD->getParameterLists ()) {
1153
- for (auto param : *paramList)
1154
- Func->addChild (constructTypeNode (Ctx, param->getInterfaceType ()));
1155
- }
1156
- if (SkipFirst) {
1157
- Func->removeChild (Func->getChildBegin () + 1 );
1153
+ for (auto param : *paramList) {
1154
+ if (!param->isSelfParameter ())
1155
+ Func->addChild (constructTypeNode (Ctx, param->getInterfaceType ()));
1156
+ }
1158
1157
}
1159
1158
return Func;
1160
1159
}
@@ -1225,9 +1224,9 @@ static SDKNode *constructVarNode(SDKContext &Ctx, ValueDecl *VD) {
1225
1224
Var->addChild (constructTypeNode (Ctx, VD->getInterfaceType ()));
1226
1225
if (auto VAD = dyn_cast<AbstractStorageDecl>(VD)) {
1227
1226
if (auto Getter = VAD->getGetter ())
1228
- Var->addChild (constructFunctionNode (Ctx, Getter, SDKNodeKind::Getter, false ));
1227
+ Var->addChild (constructFunctionNode (Ctx, Getter, SDKNodeKind::Getter));
1229
1228
if (auto Setter = VAD->getSetter ())
1230
- Var->addChild (constructFunctionNode (Ctx, Setter, SDKNodeKind::Setter, false ));
1229
+ Var->addChild (constructFunctionNode (Ctx, Setter, SDKNodeKind::Setter));
1231
1230
}
1232
1231
return Var;
1233
1232
}
@@ -1244,7 +1243,7 @@ static void addMembersToRoot(SDKContext &Ctx, SDKNode *Root,
1244
1243
if (shouldIgnore (Member))
1245
1244
continue ;
1246
1245
if (auto Func = dyn_cast<FuncDecl>(Member)) {
1247
- Root->addChild (constructFunctionNode (Ctx, Func, SDKNodeKind::Function, true ));
1246
+ Root->addChild (constructFunctionNode (Ctx, Func, SDKNodeKind::Function));
1248
1247
} else if (auto CD = dyn_cast<ConstructorDecl>(Member)) {
1249
1248
Root->addChild (constructInitNode (Ctx, CD));
1250
1249
} else if (auto VD = dyn_cast<VarDecl>(Member)) {
@@ -1334,7 +1333,7 @@ class SwiftDeclCollector : public VisibleDeclConsumer {
1334
1333
return ;
1335
1334
1336
1335
if (auto FD = dyn_cast<FuncDecl>(VD)) {
1337
- RootNode->addChild (constructFunctionNode (Ctx, FD, SDKNodeKind::Function, false ));
1336
+ RootNode->addChild (constructFunctionNode (Ctx, FD, SDKNodeKind::Function));
1338
1337
} else if (auto NTD = dyn_cast<NominalTypeDecl>(VD)) {
1339
1338
RootNode->addChild (constructTypeDeclNode (Ctx, NTD));
1340
1339
}
0 commit comments