// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
let a{protocol A{struct B{class a{#^A^#

Add SourceKit crash in swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&)
Add SourceKit crash in swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&)

found code completion token A at offset 139
swift-ide-test: /path/to/llvm/include/llvm/Support/Casting.h:95: static bool llvm::isa_impl_cl<swift::ParenType, const swift::TypeBase *>::doit(const From *) [To = swift::ParenType, From = const swift::TypeBase *]: Assertion `Val && "isa<> used on a null pointer"' failed.
10 swift-ide-test  0x0000000000b4aecf swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&) + 3039
11 swift-ide-test  0x0000000000b4a19f swift::DiagnosticEngine::flushActiveDiagnostic() + 319
15 swift-ide-test  0x0000000000936237 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
16 swift-ide-test  0x0000000000904e72 swift::typeCheckCompletionDecl(swift::Decl*) + 1122
21 swift-ide-test  0x0000000000ae4594 swift::Decl::walk(swift::ASTWalker&) + 20
22 swift-ide-test  0x0000000000b6db1e swift::SourceFile::walk(swift::ASTWalker&) + 174
23 swift-ide-test  0x0000000000b6ceff swift::ModuleDecl::walk(swift::ASTWalker&) + 79
24 swift-ide-test  0x0000000000b47602 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
25 swift-ide-test  0x0000000000863d8d swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 61
26 swift-ide-test  0x0000000000773d54 swift::CompilerInstance::performSema() + 3316
27 swift-ide-test  0x000000000071c7c3 main + 35027
Stack dump:
0.		Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.		While walking into decl getter for a at <INPUT-FILE>:2:6
2.		While type-checking 'a' at <INPUT-FILE>:2:27
