// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
class T{var f=Dictionary<T
protocol A{func<:u
#^A^#
Add test case for crash triggered in swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*)
[SourceKit] Add test case for crash triggered in swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*)

Stack trace:

```
found code completion token A at offset 151
swift-ide-test: /path/to/llvm/include/llvm/Support/Casting.h:237: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = swift::AnyFunctionType, Y = swift::TypeBase]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
14 swift-ide-test  0x00000000009cba28 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 104
15 swift-ide-test  0x00000000009d02de swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
16 swift-ide-test  0x0000000000910c25 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 661
17 swift-ide-test  0x0000000000917039 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
18 swift-ide-test  0x0000000000918150 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
19 swift-ide-test  0x00000000009182f9 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
24 swift-ide-test  0x0000000000931967 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
25 swift-ide-test  0x00000000008fd9f2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
26 swift-ide-test  0x000000000076b262 swift::CompilerInstance::performSema() + 2946
27 swift-ide-test  0x0000000000714b67 main + 33239
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking 'T' at <INPUT-FILE>:2:1
2.	While type-checking expression at [<INPUT-FILE>:2:15 - line:2:26] RangeText="Dictionary<T"
```
