Skip to content

[SR-9001] Code completion assertion failure: (genericParams && "bindExtensionDecl didn't set generic params?"), function validateExtension, file swift/lib/Sema/TypeCheckDecl.cpp #51504

Closed
@nathawes

Description

@nathawes
Previous ID SR-9001
Radar rdar://problem/45275782
Original Reporter @nathawes
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: 9996cd05a38adb1cbadee48515149384

Issue Description:

To reproduce:

$ git clone https://github.com/bignerdranch/Deferred.git
$ cd Deferred
$ git checkout -f c374a6e7072ed88ed0c79299098ca2ba7c27e720
$ open Deferred.xcodeproj

Then in Xcode: # Select the October 3 swift.org dev snapshot toolchain

  1. Navigate to Atomics.swift

  2. On line 32, add a space after “func symbol” (before "<T>") and invoke code completion

Trace:

Thread 4 Crashed:
0   libsystem_kernel.dylib        0x00007fff7443bb86 __pthread_kill + 10
1   libsystem_pthread.dylib       0x00007fff744f1c50 pthread_kill + 285
2   libsystem_c.dylib             0x00007fff743a5268 __abort + 144
3   libsystem_c.dylib             0x00007fff743a51d8 abort + 142
4   libsystem_c.dylib             0x00007fff7436d868 __assert_rtn + 320
5   com.apple.SourceKitService.4.2.2018100301_osx0x0000000105dc4026 swift::TypeChecker::validateExtension(swift::ExtensionDecl*) + 1558
6   com.apple.SourceKitService.4.2.2018100301_osx0x0000000105e588d7 swift::typeCheckCompletionDecl(swift::Decl*) + 1191
7   com.apple.SourceKitService.4.2.2018100301_osx0x0000000105605aac (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 2700
8   com.apple.SourceKitService.4.2.2018100301_osx0x0000000105f7309b swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 395
9   com.apple.SourceKitService.4.2.2018100301_osx0x00000001055f5d09 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 841
10  com.apple.SourceKitService.4.2.2018100301_osx0x00000001055f5238 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 616
11  com.apple.SourceKitService.4.2.2018100301_osx0x000000010546389f swiftCodeCompleteImpl(SourceKit::SwiftLangSupport&, llvm::MemoryBuffer*, unsigned int, (anonymous namespace)::SwiftCodeCompletionConsumer&, llvm::ArrayRef<char const*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 2511
12  com.apple.SourceKitService.4.2.2018100301_osx0x0000000105462e63 SourceKit::SwiftLangSupport::codeComplete(llvm::MemoryBuffer*, unsigned int, SourceKit::CodeCompletionConsumer&, llvm::ArrayRef<char const*>) + 131
13  com.apple.SourceKitService.4.2.2018100301_osx0x00000001054bfc32 handleSemanticRequest(sourcekitd::RequestDict, std::__1::function<void (void*)>, sourcekitd_uid_s*, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, llvm::ArrayRef<char const*>) + 818
14  com.apple.SourceKitService.4.2.2018100301_osx0x00000001054bf87e void SourceKit::WorkQueue::DispatchData::callAndDelete<handleRequestImpl(void*, std::__1::function<void (void*)>)::$_4>(void*) + 142
15  libdispatch.dylib             0x00007fff742aedcb _dispatch_client_callout + 8
16  libdispatch.dylib             0x00007fff742b1b68 _dispatch_block_invoke_direct + 260
17  com.apple.SourceKitService.4.2.2018100301_osx0x0000000107f6751f executeBlock(void*) + 15
18  com.apple.SourceKitService.4.2.2018100301_osx0x00000001055825cd ExecuteOnThread_Dispatch(void*) + 13
19  libsystem_pthread.dylib       0x00007fff744ef33d _pthread_body + 126
20  libsystem_pthread.dylib       0x00007fff744f22a7 _pthread_start + 70
21  libsystem_pthread.dylib       0x00007fff744ee425 thread_start + 13 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.code completionArea → source tooling: code completioncompilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwaresource toolingArea: IDE support, SourceKit, and other source tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions