Skip to content

Commit 162becc

Browse files
committed
Merge pull request #941 from apple/revert-244-dev
Revert "Remove unnecessary 'visitDecl' default cases."
2 parents bef0657 + d1707c0 commit 162becc

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ class UIdentVisitor : public ASTVisitor<UIdentVisitor,
156156
public:
157157
explicit UIdentVisitor(bool IsRef) : IsRef(IsRef) { }
158158

159+
/// TODO: reconsider whether having a default case is a good idea.
160+
UIdent visitDecl(const Decl *D) { return UIdent(); }
161+
159162
UIdent visitFuncDecl(const FuncDecl *D);
160163
UIdent visitVarDecl(const VarDecl *D);
161164
UIdent visitExtensionDecl(const ExtensionDecl *D);

tools/swift-ide-test/ModuleAPIDiff.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,10 @@ class SMAModelGenerator : public DeclVisitor<SMAModelGenerator> {
782782
return Result;
783783
}
784784

785+
void visitDecl(Decl *D) {
786+
// FIXME: maybe don't have a default case
787+
}
788+
785789
void visitStructDecl(StructDecl *SD) {
786790
auto ResultSD = std::make_shared<sma::StructDecl>();
787791
ResultSD->Name = convertToIdentifier(SD->getName());

0 commit comments

Comments
 (0)