Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-8568] CodeCompletion: assertion failure: (!completionType->hasUnresolvedType()) – swift::TypeChecker::typeCheckCompletionSequence #51086

Open
nathawes opened this issue Aug 17, 2018 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@nathawes
Copy link
Collaborator

Previous ID SR-8568
Radar rdar://problem/43433253
Original Reporter @nathawes
Type Bug
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, CompilerCrash
Assignee @rintaro
Priority Medium

md5: c3f8fdb816f557ad6dd182e0ce5e5369

Issue Description:

With Xcode 10 beta 6 and the August 16 swift.org dev toolchain, following the steps below hits an assertion failure:

git clone https://github.com/asynchrony/Re-Lax.git
cd Re-Lax/
git checkout -f 4502081d713257bb414d7dffa25f10ba59fa6770
open ReLax.xcworkspace

Then navigate to ReLax/ReLax/DataHelpers.swift line 83, add a space and invoke code completion after the $0 like below:

return [UInt8](UnsafeBufferPointer(start: $0 #^COMPLETE^#, count: uuid.count/MemoryLayout<UInt8>.stride))

Trace:

Crashed Thread:        5

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
dyld2 mode
Stack dump:
0.  While walking into decl 'uuidHexString()' at /private/tmp/xfails/Re-Lax/ReLax/ReLax/DataHelpers.swift:79:1
1.  While type-checking expression at [/private/tmp/xfails/Re-Lax/ReLax/ReLax/DataHelpers.swift:83:51 - line:83:51] RangeText="$"
 
Assertion failed: (!completionType->hasUnresolvedType()), function typeCheckCompletionSequence, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/Sema/TypeCheckConstraints.cpp, line 2258.
 
...

Thread 5 Crashed:
0   libsystem_kernel.dylib          0x00007fff5dad99a6 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff5db77000 pthread_kill + 285
2   libsystem_c.dylib               0x00007fff5da2c13e __abort + 144
3   libsystem_c.dylib               0x00007fff5da2c0ac abort + 142
4   libsystem_c.dylib               0x00007fff5d9f478e __assert_rtn + 320
5   com.apple.SourceKitService.4.2.2018081601_osx   0x000000010c318b5d swift::TypeChecker::typeCheckCompletionSequence(swift::Expr*&, swift::DeclContext*) + 1357
6   com.apple.SourceKitService.4.2.2018081601_osx   0x000000010bbda0a3 (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 23939
7   com.apple.SourceKitService.4.2.2018081601_osx   0x000000010c4e7f70 (anonymous namespace)::ParseDelayedFunctionBodies::walkToDeclPre(swift::Decl*) + 304
8   com.apple.SourceKitService.4.2.2018081601_osx   0x000000010c598cfb (anonymous namespace)::Traversal::doIt(swift::Decl*) + 171
9   com.apple.SourceKitService.4.2.2018081601_osx   0x000000010c598c3b swift::Decl::walk(swift::ASTWalker&) + 27
10  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010c64f24a swift::SourceFile::walk(swift::ASTWalker&) + 170
11  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010c64db0f swift::ModuleDecl::walk(swift::ASTWalker&) + 95
12  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010c4e02f7 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 215
13  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010bbbd769 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 1081
14  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010bbbcae3 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 627
15  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010ba2fd4f 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> >&) + 2159
16  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010ba2f473 SourceKit::SwiftLangSupport::codeComplete(llvm::MemoryBuffer*, unsigned int, SourceKit::CodeCompletionConsumer&, llvm::ArrayRef<char const*>) + 131
17  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010ba8bd25 handleSemanticRequest(sourcekitd::RequestDict, std::__1::function<void (void*)>, sourcekitd_uid_s*, llvm::Optional<llvm::StringRef>, llvm::Optional<llvm::StringRef>, llvm::ArrayRef<char const*>) + 725
18  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010ba8b9d5 void SourceKit::WorkQueue::DispatchData::callAndDelete<handleRequestImpl(void*, std::__1::function<void (void*)>)::$_4>(void*) + 149
19  libdispatch.dylib               0x00007fff5d9359a6 _dispatch_client_callout + 8
20  libdispatch.dylib               0x00007fff5d94624e _dispatch_block_invoke_direct + 262
21  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010e46639f executeBlock(void*) + 15
22  com.apple.SourceKitService.4.2.2018081601_osx   0x000000010bb4c23d ExecuteOnThread_Dispatch(void*) + 13
23  libsystem_pthread.dylib         0x00007fff5db74bc6 _pthread_body + 128
24  libsystem_pthread.dylib         0x00007fff5db74b32 _pthread_start + 70
25  libsystem_pthread.dylib         0x00007fff5db746f9 thread_start + 13
@nathawes
Copy link
Collaborator Author

@swift-ci create

@rintaro
Copy link
Mannequin

rintaro mannequin commented Aug 20, 2018

#18841

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added crash Bug: A crash, i.e., an abnormal termination of software compiler The Swift compiler in itself labels Dec 12, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

2 participants