// This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors

// RUN: not --crash %target-swift-frontend %s -parse
class a{let e=(T:{var f:a
let _=(T:f

Add test case for crash triggered in swift::constraints::Solution::coerceToType(swift::Expr*, swift::Type, swift::constraints::ConstraintLocator*, bool) const
[swiftc] Add test case for crash triggered in swift::constraints::Solution::coerceToType(swift::Expr*, swift::Type, swift::constraints::ConstraintLocator*, bool) const

Stack trace:

```
6  swift           0x00000000031374dd llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461
8  swift           0x0000000000efa916 swift::constraints::Solution::coerceToType(swift::Expr*, swift::Type, swift::constraints::ConstraintLocator*, bool) const + 326
10 swift           0x0000000000e5bd47 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 903
11 swift           0x0000000000e5cdc2 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 162
12 swift           0x0000000000e5cf9b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
15 swift           0x0000000000e6dc66 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
18 swift           0x0000000000ecd42a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
19 swift           0x0000000000ef759c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
20 swift           0x0000000000e5bcaa swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
21 swift           0x0000000000e5cdc2 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 162
22 swift           0x0000000000e5cf9b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
27 swift           0x0000000000e6dc66 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
28 swift           0x0000000000e909c2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 994
29 swift           0x0000000000cd4cff swift::CompilerInstance::performSema() + 3087
31 swift           0x000000000078ee8c frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2492
32 swift           0x0000000000789915 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28282-swift-constraints-solution-coercetotype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28282-swift-constraints-solution-coercetotype-a03df3.o
1.	While type-checking 'a' at validation-test/compiler_crashers/28282-swift-constraints-solution-coercetotype.swift:9:1
2.	While type-checking expression at [validation-test/compiler_crashers/28282-swift-constraints-solution-coercetotype.swift:9:15 - line:10:10] RangeText="(T:{var f:a
3.	While type-checking declaration 0x67a9c78 at validation-test/compiler_crashers/28282-swift-constraints-solution-coercetotype.swift:10:1
4.	While type-checking expression at [validation-test/compiler_crashers/28282-swift-constraints-solution-coercetotype.swift:10:7 - line:10:10] RangeText="(T:f"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
