// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
let a{s{func b<T{protocol P{let t:T
#^A^#
Add test case for crash triggered in swift::TypeChecker::typeCheckDecl(swift::Decl*, bool)
[SourceKit] Add test case for crash triggered in swift::TypeChecker::typeCheckDecl(swift::Decl*, bool)

Stack trace:

```
found code completion token A at offset 162
swift-ide-test: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:4062: void (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl *): Assertion `!FD->getType()->hasTypeParameter()' failed.
10 swift-ide-test  0x0000000000931ec7 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
11 swift-ide-test  0x000000000098a9f3 swift::convertStoredVarInProtocolToComputed(swift::VarDecl*, swift::TypeChecker&) + 115
16 swift-ide-test  0x0000000000931ec7 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
19 swift-ide-test  0x000000000097842b swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 379
20 swift-ide-test  0x000000000097826e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
21 swift-ide-test  0x0000000000900e28 swift::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 1128
26 swift-ide-test  0x0000000000ae1df4 swift::Decl::walk(swift::ASTWalker&) + 20
27 swift-ide-test  0x0000000000b6baae swift::SourceFile::walk(swift::ASTWalker&) + 174
28 swift-ide-test  0x0000000000b6acdf swift::ModuleDecl::walk(swift::ASTWalker&) + 79
29 swift-ide-test  0x0000000000b44e42 swift::DeclContext::walkContext(swift::ASTWalker&) + 146
30 swift-ide-test  0x000000000085cd6a swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 138
31 swift-ide-test  0x000000000076bb24 swift::CompilerInstance::performSema() + 3316
32 swift-ide-test  0x00000000007152b7 main + 33239
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>:3:6
2.	While type-checking 'P' at <INPUT-FILE>:3:18
3.	While type-checking getter for t at <INPUT-FILE>:3:33
```
