[index] Fix dynamicMemberLookup subscript reference implicit role

When building the implicit subscript expression, set the "implicit" bit
correctly and pass it through in the indexer so that we get implicit
refernces to the subscript. This would be useful for e.g. searching for
all uses of the dynamic subscript.
This commit is contained in:
Ben Langmuir
2019-04-02 16:43:27 -07:00
parent 0224d40551
commit 6af24d083c
10 changed files with 56 additions and 35 deletions

View File

@@ -1038,11 +1038,10 @@ public:
}
bool visitSubscriptReference(ValueDecl *D, CharSourceRange Range,
Optional<AccessKind> AccKind,
ReferenceMetaData Data,
bool IsOpenBracket) override {
// Treat both open and close brackets equally
return visitDeclReference(D, Range, nullptr, nullptr, Type(),
ReferenceMetaData(SemaReferenceKind::SubscriptRef, AccKind));
return visitDeclReference(D, Range, nullptr, nullptr, Type(), Data);
}
bool isLocal(Decl *D) const {