// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
:#^A^#func a
protocol a{class A:a
typealias e:A.e
Add test case for crash triggered in swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*)
[SourceKit] Add test case for crash triggered in swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*)

Stack trace:

```
found code completion token A at offset 127
6  swift-ide-test  0x000000000095ab41 swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*) + 193
7  swift-ide-test  0x0000000000b7a906 swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 150
8  swift-ide-test  0x0000000000b7a848 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 40
9  swift-ide-test  0x0000000000b7afe6 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 6
10 swift-ide-test  0x0000000000952c4e swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 1070
12 swift-ide-test  0x000000000097ba3e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
14 swift-ide-test  0x000000000097c944 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
15 swift-ide-test  0x000000000097b94a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
16 swift-ide-test  0x0000000000928a6a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4890
21 swift-ide-test  0x000000000092c021 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 5969
22 swift-ide-test  0x0000000000b71fcc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
23 swift-ide-test  0x000000000095293a swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 282
25 swift-ide-test  0x000000000097ba3e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
27 swift-ide-test  0x000000000097c944 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
28 swift-ide-test  0x000000000097b94a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
29 swift-ide-test  0x00000000009eb7e2 swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 146
30 swift-ide-test  0x00000000009eaa6d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
31 swift-ide-test  0x0000000000927709 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) + 137
32 swift-ide-test  0x000000000092ace1 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1041
34 swift-ide-test  0x0000000000930296 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
35 swift-ide-test  0x00000000008fca42 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
36 swift-ide-test  0x000000000076b4f2 swift::CompilerInstance::performSema() + 2946
37 swift-ide-test  0x0000000000714d83 main + 33379
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:3
2.	While resolving type A.e at [<INPUT-FILE>:5:13 - line:5:15] RangeText="A.e"
3.	While type-checking 'a' at <INPUT-FILE>:4:1
4.	While resolving type A.e at [<INPUT-FILE>:5:13 - line:5:15] RangeText="A.e"
```
