// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
enum A<h{
class a
protocol c{{
}func b
#^A^#
class b<T:e>:a
{}class e
Add test case for crash triggered in swift::IterativeTypeChecker::processTypeCheckSuperclass(swift::ClassDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>)
[SourceKit] Add test case for crash triggered in swift::IterativeTypeChecker::processTypeCheckSuperclass(swift::ClassDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>)

Stack trace:

```
found code completion token A at offset 165
swift-ide-test: /path/to/swift/lib/AST/Decl.cpp:4855: void swift::ClassDecl::setSuperclass(swift::Type): Assertion `(!superclass || !superclass->hasArchetype()) && "superclass must be interface type"' failed.
9  swift-ide-test  0x0000000000a8f92d swift::IterativeTypeChecker::processTypeCheckSuperclass(swift::ClassDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 269
10 swift-ide-test  0x0000000000a72a0d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
11 swift-ide-test  0x000000000097ea90 swift::TypeChecker::resolveSuperclass(swift::ClassDecl*) + 64
12 swift-ide-test  0x0000000000c876c9 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 217
13 swift-ide-test  0x0000000000c8af52 swift::ConformanceLookupTable::lookupConformance(swift::ModuleDecl*, swift::NominalTypeDecl*, swift::ProtocolDecl*, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 50
14 swift-ide-test  0x0000000000c5007f swift::ModuleDecl::lookupConformance(swift::Type, swift::ProtocolDecl*, swift::LazyResolver*) + 1103
15 swift-ide-test  0x00000000009cf01a swift::TypeChecker::conformsToProtocol(swift::Type, swift::ProtocolDecl*, swift::DeclContext*, swift::OptionSet<swift::ConformanceCheckFlags, unsigned int>, swift::ProtocolConformance**, swift::SourceLoc) + 106
16 swift-ide-test  0x00000000009f5b7d swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 1309
20 swift-ide-test  0x00000000009f70be swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
22 swift-ide-test  0x00000000009f8014 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
23 swift-ide-test  0x00000000009f6fb0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
24 swift-ide-test  0x000000000098010a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5322
25 swift-ide-test  0x00000000009c07f5 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 389
26 swift-ide-test  0x00000000009c2107 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
27 swift-ide-test  0x00000000009c2c6f swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 111
28 swift-ide-test  0x00000000009816eb swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 363
34 swift-ide-test  0x0000000000986ee6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
35 swift-ide-test  0x00000000009ab6d2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
36 swift-ide-test  0x00000000007a6dc9 swift::CompilerInstance::performSema() + 3289
37 swift-ide-test  0x000000000074a181 main + 34609
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking 'A' at <INPUT-FILE>:3:1
2.	While resolving type e at [<INPUT-FILE>:8:11 - line:8:11] RangeText="e"
```
