Uploaded image for project: 'Swift'
  1. Swift
  2. SR-11698

Code completion hits assertion: (resolver && "Need to resolve generic parameter depth")

    XMLWordPrintable

    Details

      Description

      Reproducer:

      extension StringProtocol {
          public func components<T>(separatedBy separator: T) -> [String] where T : StringProtocol {fatalError()}
      }
      _ = ["hello"].joined().components(separatedBy: ./*complete here*/
      

      Trace:

      Assertion failed: (resolver && "Need to resolve generic parameter depth"), function computeCanonicalType, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/AST/Type.cpp, line 1150.
      
      Thread 1 Crashed:: Dispatch queue: com.apple.root.default-qos
      0   libsystem_kernel.dylib        	0x00007fff5ee6f2c6 __pthread_kill + 10
      1   libsystem_pthread.dylib       	0x00007fff5ef2abf1 pthread_kill + 284
      2   libsystem_c.dylib             	0x00007fff5edd9745 __abort + 144
      3   libsystem_c.dylib             	0x00007fff5edd96b5 abort + 142
      4   libsystem_c.dylib             	0x00007fff5eda220d __assert_rtn + 324
      5   com.apple.SourceKitService.5.0.20191024101_osx	0x000000010a819aa3 swift::TypeBase::computeCanonicalType() (.cold.12) + 35
      6   com.apple.SourceKitService.5.0.20191024101_osx	0x0000000108761fc7 swift::TypeBase::computeCanonicalType() + 3671
      7   com.apple.SourceKitService.5.0.20191024101_osx	0x00000001087617f6 swift::TypeBase::computeCanonicalType() + 1670
      8   com.apple.SourceKitService.5.0.20191024101_osx	0x000000010875d92c swift::TypeBase::isEqual(swift::Type) + 76
      9   com.apple.SourceKitService.5.0.20191024101_osx	0x00000001086cacb6 swift::DiagnosticEngine::formatDiagnosticText(llvm::raw_ostream&, llvm::StringRef, llvm::ArrayRef<swift::DiagnosticArgument>, swift::DiagnosticFormatOptions) + 4726
      10  com.apple.SourceKitService.5.0.20191024101_osx	0x000000010796c426 SourceKit::EditorDiagConsumer::handleDiagnostic(swift::SourceManager&, swift::SourceLoc, swift::DiagnosticKind, llvm::StringRef, llvm::ArrayRef<swift::DiagnosticArgument>, swift::DiagnosticInfo const&, swift::SourceLoc) + 742
      11  com.apple.SourceKitService.5.0.20191024101_osx	0x00000001086cc82d swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&) + 333
      12  com.apple.SourceKitService.5.0.20191024101_osx	0x00000001086c9996 swift::DiagnosticEngine::flushActiveDiagnostic() + 278
      13  com.apple.SourceKitService.5.0.20191024101_osx	0x00000001082f31c0 swift::IsStaticRequest::evaluate(swift::Evaluator&, swift::FuncDecl*) const + 448
      14  com.apple.SourceKitService.5.0.20191024101_osx	0x0000000108377121 swift::SimpleRequest<swift::IsStaticRequest, bool (swift::FuncDecl*), (swift::CacheKind)2>::evaluateRequest(swift::IsStaticRequest const&, swift::Evaluator&) + 17
      15  com.apple.SourceKitService.5.0.20191024101_osx	0x00000001086bc950 llvm::Expected<swift::IsStaticRequest::OutputType> swift::Evaluator::getResultUncached<swift::IsStaticRequest>(swift::IsStaticRequest const&) + 384
      16  com.apple.SourceKitService.5.0.20191024101_osx	0x00000001086bc6f8 llvm::Expected<swift::IsStaticRequest::OutputType> swift::Evaluator::getResultCached<swift::IsStaticRequest, (void*)0>(swift::IsStaticRequest const&) + 56
      17  com.apple.SourceKitService.5.0.20191024101_osx	0x00000001086bbb3b llvm::Expected<swift::IsStaticRequest::OutputType> swift::Evaluator::operator()<swift::IsStaticRequest>(swift::IsStaticRequest const&) + 107
      18  com.apple.SourceKitService.5.0.20191024101_osx	0x0000000108674ef2 swift::IsStaticRequest::OutputType swift::evaluateOrDefault<swift::IsStaticRequest>(swift::Evaluator&, swift::IsStaticRequest, swift::IsStaticRequest::OutputType) + 34
      19  com.apple.SourceKitService.5.0.20191024101_osx	0x0000000107b4b078 (anonymous namespace)::ModelASTWalker::walkToDeclPre(swift::Decl*) + 984
      20  com.apple.SourceKitService.5.0.20191024101_osx	0x0000000108638a4a (anonymous namespace)::Traversal::doIt(swift::Decl*) + 170
      21  com.apple.SourceKitService.5.0.20191024101_osx	0x000000010863dfdb (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 523
      22  com.apple.SourceKitService.5.0.20191024101_osx	0x0000000108638a77 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
      23  com.apple.SourceKitService.5.0.20191024101_osx	0x000000010863898b swift::Decl::walk(swift::ASTWalker&) + 27
      24  com.apple.SourceKitService.5.0.20191024101_osx	0x000000010872fcfe swift::SourceFile::walk(swift::ASTWalker&) + 190
      25  com.apple.SourceKitService.5.0.20191024101_osx	0x0000000107b48f3b swift::ide::SyntaxModelContext::walk(swift::ide::SyntaxModelWalker&) + 315
      26  com.apple.SourceKitService.5.0.20191024101_osx	0x000000010796f863 SourceKit::SwiftEditorDocument::readSyntaxInfo(SourceKit::EditorConsumer&) + 1139
      27  com.apple.SourceKitService.5.0.20191024101_osx	0x0000000107973746 SourceKit::SwiftLangSupport::editorReplaceText(llvm::StringRef, llvm::MemoryBuffer*, unsigned int, unsigned int, SourceKit::EditorConsumer&) + 1062
      28  com.apple.SourceKitService.5.0.20191024101_osx	0x00000001079ada1e handleRequestImpl(void*, std::__1::function<void (void*)>) + 13678
      29  com.apple.SourceKitService.5.0.20191024101_osx	0x00000001079aa463 sourcekitd::handleRequest(void*, std::__1::function<void (void*)>) + 275
      30  com.apple.SourceKitService.5.0.20191024101_osx	0x0000000107939908 invocation function for block in sourcekitdServer_peer_event_handler(_xpc_connection_s*, void*) + 216
      31  libdispatch.dylib             	0x00007fff5ece65f8 _dispatch_call_block_and_release + 12
      32  libdispatch.dylib             	0x00007fff5ece763d _dispatch_client_callout + 8
      33  libdispatch.dylib             	0x00007fff5ece9a53 _dispatch_queue_override_invoke + 763
      34  libdispatch.dylib             	0x00007fff5ecf53bc _dispatch_root_queue_drain + 324
      35  libdispatch.dylib             	0x00007fff5ecf5b46 _dispatch_worker_thread2 + 90
      36  libsystem_pthread.dylib       	0x00007fff5ef276b3 _pthread_wqthread + 583
      37  libsystem_pthread.dylib       	0x00007fff5ef273fd start_wqthread + 13
      

       

        Attachments

          Activity

            People

            Assignee:
            nathawes Nathan Hawes
            Reporter:
            nathawes Nathan Hawes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: