File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1589,8 +1589,22 @@ bool IndexSwiftASTWalker::report(ValueDecl *D) {
15891589 return false ;
15901590 }
15911591 } else if (auto NTD = dyn_cast<NominalTypeDecl>(D)) {
1592- if (!reportInheritedTypeRefs (NTD->getInherited (), NTD))
1593- return false ;
1592+ auto *PD = dyn_cast<ProtocolDecl>(D);
1593+ if (PD && PD->wasDeserialized ()) {
1594+ // Deserialized protocols don't have an inheritance clause.
1595+ for (auto *inherited : PD->getInheritedProtocols ()) {
1596+ // FIXME(noncopyable_generics): Do we want to include these?
1597+ if (inherited->getInvertibleProtocolKind ())
1598+ continue ;
1599+
1600+ if (!reportRelatedRef (inherited, SourceLoc (), /* isImplicit=*/ false ,
1601+ (SymbolRoleSet) SymbolRole::RelationBaseOf, PD))
1602+ return false ;
1603+ }
1604+ } else {
1605+ if (!reportInheritedTypeRefs (NTD->getInherited (), NTD))
1606+ return false ;
1607+ }
15941608 }
15951609 } else {
15961610 // Even if we don't record a local property we still need to walk its
You can’t perform that action at this time.
0 commit comments