// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
struct B<T{protocol P{let:B<T>struct B<e#^A^#
Add test case for crash triggered in swift::TypeChecker::checkGenericArguments(swift::DeclContext*, swift::SourceLoc, swift::SourceLoc, swift::Type, swift::GenericSignature*, llvm::ArrayRef<swift::Type>)
[SourceKit] Add test case for crash triggered in swift::TypeChecker::checkGenericArguments(swift::DeclContext*, swift::SourceLoc, swift::SourceLoc, swift::Type, swift::GenericSignature*, llvm::ArrayRef<swift::Type>)

Stack trace:

```
found code completion token A at offset 166
swift-ide-test: /path/to/llvm/include/llvm/ADT/ArrayRef.h:186: const T &llvm::ArrayRef<swift::Type>::operator[](size_t) const [T = swift::Type]: Assertion `Index < Length && "Invalid index!"' failed.
8  swift-ide-test  0x0000000000952645 swift::TypeChecker::checkGenericArguments(swift::DeclContext*, swift::SourceLoc, swift::SourceLoc, swift::Type, swift::GenericSignature*, llvm::ArrayRef<swift::Type>) + 1365
9  swift-ide-test  0x000000000097de13 swift::TypeChecker::applyGenericArguments(swift::Type, swift::SourceLoc, swift::DeclContext*, llvm::MutableArrayRef<swift::TypeLoc>, bool, swift::GenericTypeResolver*) + 915
14 swift-ide-test  0x000000000097e0ce swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
16 swift-ide-test  0x000000000097dfc4 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 212
18 swift-ide-test  0x0000000000956531 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 721
25 swift-ide-test  0x0000000000931ec7 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
26 swift-ide-test  0x00000000008fdfd2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
27 swift-ide-test  0x000000000076b9b2 swift::CompilerInstance::performSema() + 2946
28 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 type-checking 'B' at <INPUT-FILE>:3:1
2.	While resolving type B<T> at [<INPUT-FILE>:3:27 - line:3:30] RangeText="B<T>"
```
