@@ -966,8 +966,18 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
966
966
bool startEntityDecl (ValueDecl *D);
967
967
968
968
bool reportRelatedRef (ValueDecl *D, SourceLoc Loc, bool isImplicit, SymbolRoleSet Relations, Decl *Related);
969
+
970
+ // / Report references for dependent types
971
+ // /
972
+ // / NOTE: If the dependent type is a typealias, report the underlying types as well.
973
+ // /
974
+ // / \param Ty The type being referenced.
975
+ // / \param Relations The relationship between the referenced type and the passed Decl.
976
+ // / \param Related The Decl that is referencing the type.
977
+ // / \param isImplicit Whether the reference is implicit, such as for a typealias' underlying type.
978
+ // / \param Loc The location of the reference, otherwise the location of the TypeLoc is used.
969
979
bool reportRelatedTypeRef (const TypeLoc &Ty, SymbolRoleSet Relations, Decl *Related,
970
- bool isImplicit=false , const Optional<SourceLoc> Loc=Optional<SourceLoc>());
980
+ bool isImplicit=false , Optional<SourceLoc> Loc=Optional<SourceLoc>());
971
981
bool reportInheritedTypeRefs (
972
982
ArrayRef<InheritedEntry> Inherited, Decl *Inheritee);
973
983
NominalTypeDecl *getTypeLocAsNominalTypeDecl (const TypeLoc &Ty);
@@ -1384,7 +1394,7 @@ bool IndexSwiftASTWalker::reportInheritedTypeRefs(ArrayRef<InheritedEntry> Inher
1384
1394
}
1385
1395
1386
1396
bool IndexSwiftASTWalker::reportRelatedTypeRef (const TypeLoc &Ty, SymbolRoleSet Relations,
1387
- Decl *Related, bool Implicit, const Optional<SourceLoc> Loc) {
1397
+ Decl *Related, bool Implicit, Optional<SourceLoc> Loc) {
1388
1398
if (auto *composite = llvm::dyn_cast_or_null<CompositionTypeRepr>(Ty.getTypeRepr ())) {
1389
1399
SourceLoc IdLoc = Loc.value_or (composite->getSourceLoc ());
1390
1400
for (auto *Type : composite->getTypes ())
0 commit comments