Skip to content

Revert "Remove unnecessary 'visitDecl' default cases." #941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ class UIdentVisitor : public ASTVisitor<UIdentVisitor,
public:
explicit UIdentVisitor(bool IsRef) : IsRef(IsRef) { }

/// TODO: reconsider whether having a default case is a good idea.
UIdent visitDecl(const Decl *D) { return UIdent(); }

UIdent visitFuncDecl(const FuncDecl *D);
UIdent visitVarDecl(const VarDecl *D);
UIdent visitExtensionDecl(const ExtensionDecl *D);
Expand Down
4 changes: 4 additions & 0 deletions tools/swift-ide-test/ModuleAPIDiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,10 @@ class SMAModelGenerator : public DeclVisitor<SMAModelGenerator> {
return Result;
}

void visitDecl(Decl *D) {
// FIXME: maybe don't have a default case
}

void visitStructDecl(StructDecl *SD) {
auto ResultSD = std::make_shared<sma::StructDecl>();
ResultSD->Name = convertToIdentifier(SD->getName());
Expand Down