File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class SynthesizedFileUnit final : public FileUnit {
28
28
SourceFile &SF;
29
29
30
30
// / Synthesized top level declarations.
31
- TinyPtrVector<ValueDecl *> TopLevelDecls;
31
+ TinyPtrVector<Decl *> TopLevelDecls;
32
32
33
33
// / A unique identifier representing this file; used to mark private decls
34
34
// / within the file to keep them from conflicting with other files in the
@@ -43,7 +43,7 @@ class SynthesizedFileUnit final : public FileUnit {
43
43
SourceFile &getSourceFile () const { return SF; }
44
44
45
45
// / Add a synthesized top-level declaration.
46
- void addTopLevelDecl (ValueDecl *D) { TopLevelDecls.push_back (D); }
46
+ void addTopLevelDecl (Decl *D) { TopLevelDecls.push_back (D); }
47
47
48
48
virtual void lookupValue (DeclName name, NLKind lookupKind,
49
49
SmallVectorImpl<ValueDecl *> &result) const override ;
@@ -56,7 +56,7 @@ class SynthesizedFileUnit final : public FileUnit {
56
56
57
57
void getTopLevelDecls (SmallVectorImpl<Decl*> &results) const override ;
58
58
59
- ArrayRef<ValueDecl *> getTopLevelDecls () const {
59
+ ArrayRef<Decl *> getTopLevelDecls () const {
60
60
return TopLevelDecls;
61
61
};
62
62
Original file line number Diff line number Diff line change @@ -2996,8 +2996,11 @@ void SynthesizedFileUnit::lookupValue(
2996
2996
DeclName name, NLKind lookupKind,
2997
2997
SmallVectorImpl<ValueDecl *> &result) const {
2998
2998
for (auto *decl : TopLevelDecls) {
2999
- if (decl->getName ().matchesRef (name))
3000
- result.push_back (decl);
2999
+ if (auto VD = dyn_cast<ValueDecl>(decl)) {
3000
+ if (VD->getName ().matchesRef (name)) {
3001
+ result.push_back (VD);
3002
+ }
3003
+ }
3001
3004
}
3002
3005
}
3003
3006
You can’t perform that action at this time.
0 commit comments