@@ -1167,7 +1167,7 @@ bool IndexSwiftASTWalker::report(ValueDecl *D) {
11671167 // Pass accessors.
11681168 if (auto StoreD = dyn_cast<AbstractStorageDecl>(D)) {
11691169 bool usedPseudoAccessors = false ;
1170- if (isa<VarDecl>(D) &&
1170+ if (isa<VarDecl>(D) && !isa<ParamDecl>(D) &&
11711171 !StoreD->getParsedAccessor (AccessorKind::Get) &&
11721172 !StoreD->getParsedAccessor (AccessorKind::Set)) {
11731173 usedPseudoAccessors = true ;
@@ -1256,17 +1256,19 @@ bool IndexSwiftASTWalker::reportRef(ValueDecl *D, SourceLoc Loc,
12561256
12571257 // Report the accessors that were utilized.
12581258 if (auto *ASD = dyn_cast<AbstractStorageDecl>(D)) {
1259- bool UsesGetter = Info.roles & (SymbolRoleSet)SymbolRole::Read;
1260- bool UsesSetter = Info.roles & (SymbolRoleSet)SymbolRole::Write;
1259+ if (!isa<ParamDecl>(D)) {
1260+ bool UsesGetter = Info.roles & (SymbolRoleSet)SymbolRole::Read;
1261+ bool UsesSetter = Info.roles & (SymbolRoleSet)SymbolRole::Write;
12611262
1262- if (UsesGetter)
1263- if (!reportPseudoAccessor (ASD, AccessorKind::Get, /* IsRef=*/ true ,
1264- Loc))
1265- return false ;
1266- if (UsesSetter)
1267- if (!reportPseudoAccessor (ASD, AccessorKind::Set, /* IsRef=*/ true ,
1268- Loc))
1269- return false ;
1263+ if (UsesGetter)
1264+ if (!reportPseudoAccessor (ASD, AccessorKind::Get, /* IsRef=*/ true ,
1265+ Loc))
1266+ return false ;
1267+ if (UsesSetter)
1268+ if (!reportPseudoAccessor (ASD, AccessorKind::Set, /* IsRef=*/ true ,
1269+ Loc))
1270+ return false ;
1271+ }
12701272 }
12711273
12721274 return finishCurrentEntity ();
0 commit comments