mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Ignore references without a location
A keypath using dynamic member lookup results in various `KeyPathExpr` that have components with no location. Ignore these and any other references that have a missing location. Resolves rdar://85237365
This commit is contained in:
@@ -1143,7 +1143,7 @@ public:
|
||||
bool visitDeclReference(ValueDecl *D, CharSourceRange Range,
|
||||
TypeDecl *CtorTyRef, ExtensionDecl *ExtTyRef, Type Ty,
|
||||
ReferenceMetaData Data) override {
|
||||
if (Data.isImplicit)
|
||||
if (Data.isImplicit || !Range.isValid())
|
||||
return true;
|
||||
unsigned StartOffset = getOffset(Range.getStart());
|
||||
References.emplace_back(D, StartOffset, Range.getByteLength(), Ty);
|
||||
|
||||
Reference in New Issue
Block a user