Skip to content

Commit e8d48e4

Browse files
[SourceKit] Add test case for crash triggered in swift::ArchetypeBuilder::getAllArchetypes()
Stack trace: ``` found code completion token A at offset 229 swift-ide-test: /path/to/swift/include/swift/AST/Types.h:3582: swift::ArchetypeType *swift::ArchetypeType::NestedType::castToArchetype() const: Assertion `!isConcreteType()' failed. 8 swift-ide-test 0x0000000000a94424 swift::ArchetypeBuilder::getAllArchetypes() + 564 12 swift-ide-test 0x00000000009312b7 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151 15 swift-ide-test 0x00000000009777db swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 379 16 swift-ide-test 0x000000000097761e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46 17 swift-ide-test 0x0000000000900278 swift::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 1128 21 swift-ide-test 0x0000000000adf4d4 swift::Decl::walk(swift::ASTWalker&) + 20 22 swift-ide-test 0x0000000000b6918e swift::SourceFile::walk(swift::ASTWalker&) + 174 23 swift-ide-test 0x0000000000b683bf swift::ModuleDecl::walk(swift::ASTWalker&) + 79 24 swift-ide-test 0x0000000000b42522 swift::DeclContext::walkContext(swift::ASTWalker&) + 146 25 swift-ide-test 0x000000000085c1ba swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 138 26 swift-ide-test 0x000000000076b1e4 swift::CompilerInstance::performSema() + 3316 27 swift-ide-test 0x0000000000714977 main + 33239 Stack dump: 0. Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE> 1. While walking into decl getter for e at <INPUT-FILE>:3:6 2. While type-checking 'b' at <INPUT-FILE>:8:10 ```
1 parent b85992e commit e8d48e4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
2+
// REQUIRES: asserts
3+
var e{
4+
protocol A{
5+
func b:e protocol e{
6+
typealias e:e:protocol e{
7+
enum a{
8+
func a<d{func b<a
9+
protocol c:#^A^#

0 commit comments

Comments
 (0)