// 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
enum a{var f={struct A where h:b

Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*)

Stack trace:

```
4  swift           0x0000000000ed76ca swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 74
5  swift           0x0000000000ed8ef7 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
6  swift           0x0000000000ed9296 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102
7  swift           0x0000000000e9ad4f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 367
10 swift           0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
13 swift           0x0000000000f060c4 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
14 swift           0x0000000000f3094c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
15 swift           0x0000000000e8e211 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
16 swift           0x0000000000e8f2c7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
17 swift           0x0000000000e8f4db swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
22 swift           0x0000000000ea0566 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
23 swift           0x0000000000ec3812 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 994
24 swift           0x0000000000c585e9 swift::CompilerInstance::performSema() + 3289
26 swift           0x00000000007d6f4f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863
27 swift           0x00000000007a2f58 main + 2872
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28304-swift-typechecker-checkgenericparamlist.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28304-swift-typechecker-checkgenericparamlist-450da6.o
1.	While type-checking 'a' at validation-test/compiler_crashers/28304-swift-typechecker-checkgenericparamlist.swift:9:1
2.	While type-checking expression at [validation-test/compiler_crashers/28304-swift-typechecker-checkgenericparamlist.swift:9:14 - line:9:32] RangeText="{struct A where h:b"
3.	While type-checking 'A' at validation-test/compiler_crashers/28304-swift-typechecker-checkgenericparamlist.swift:9:15
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
