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

Conforming Method List: Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!")

    XMLWordPrintable

    Details

      Description

      The completion-like conforming method list request hits an assertion when invoked after module references:

       Swift#^COMPLETE^#

       

      Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file llvm-project/llvm/include/llvm/Support/Casting.h, line 269.
      PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
      Stack dump:
      0.	Program arguments: ../build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swift-ide-test --conforming-methods --conforming-methods-expected-types=s:SQ -source-filename /tmp/test.swift -code-completion-token=COMPLETE
      1.	While performing new completion
      2.	While evaluating request CodeCompletionSecondPassRequest(source_file "/tmp/test.swift", )
      Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
      0  swift-ide-test           0x0000000114f3a7ad llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 61
      1  swift-ide-test           0x0000000114f3acdb PrintStackTraceSignalHandler(void*) + 27
      2  swift-ide-test           0x0000000114f38b5b llvm::sys::RunSignalHandlers() + 123
      3  swift-ide-test           0x0000000114f3c8fd SignalHandler(int) + 205
      4  libsystem_platform.dylib 0x00007fff203a4d7d _sigtramp + 29
      5  libdyld.dylib            0x00007fff2037a473 dyldGlobalLockRelease() + 0
      6  libsystem_c.dylib        0x00007fff202b3720 abort + 120
      7  libsystem_c.dylib        0x00007fff202b29d6 err + 0
      8  swift-ide-test           0x00000001093614c2 llvm::cast_retty<swift::AnyFunctionType, swift::TypeBase*>::ret_type llvm::cast<swift::AnyFunctionType, swift::TypeBase>(swift::TypeBase*) + 98
      9  swift-ide-test           0x0000000109378e3d swift::AnyFunctionType* swift::TypeBase::castTo<swift::AnyFunctionType>() + 29
      10 swift-ide-test           0x0000000109f793c0 (anonymous namespace)::ConformingMethodListCallbacks::getMatchingMethods(swift::Type, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&, llvm::SmallVectorImpl<swift::ValueDecl*>&)::LocalConsumer::isMatchingMethod(swift::ValueDecl*) + 304
      11 swift-ide-test           0x0000000109f79257 (anonymous namespace)::ConformingMethodListCallbacks::getMatchingMethods(swift::Type, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&, llvm::SmallVectorImpl<swift::ValueDecl*>&)::LocalConsumer::foundDecl(swift::ValueDecl*, swift::DeclVisibilityKind, swift::DynamicLookupInfo) + 39
      12 swift-ide-test           0x000000010bb7d6ea (anonymous namespace)::OverrideFilteringConsumer::filterDecls(swift::VisibleDeclConsumer&) + 2634
      13 swift-ide-test           0x000000010bb7c8af lookupVisibleMemberDecls(swift::Type, swift::VisibleDeclConsumer&, swift::DeclContext const*, (anonymous namespace)::LookupState, swift::DeclVisibilityKind, swift::GenericSignatureBuilder*) + 367
      14 swift-ide-test           0x000000010bb7c673 swift::lookupVisibleMemberDecls(swift::VisibleDeclConsumer&, swift::Type, swift::DeclContext const*, bool, bool, bool, swift::GenericSignatureBuilder*) + 243
      15 swift-ide-test           0x0000000109f78d49 (anonymous namespace)::ConformingMethodListCallbacks::getMatchingMethods(swift::Type, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&, llvm::SmallVectorImpl<swift::ValueDecl*>&) + 217
      16 swift-ide-test           0x0000000109f7860e (anonymous namespace)::ConformingMethodListCallbacks::doneParsing() + 798
      17 swift-ide-test           0x000000010c8e30c0 swift::Parser::performCodeCompletionSecondPassImpl(swift::CodeCompletionDelayedDeclState&) + 1264
      18 swift-ide-test           0x000000010c8e28b8 swift::CodeCompletionSecondPassRequest::evaluate(swift::Evaluator&, swift::SourceFile*, swift::CodeCompletionCallbacksFactory*) const + 376
      19 swift-ide-test           0x000000010c91d679 bool swift::SimpleRequest<swift::CodeCompletionSecondPassRequest, bool (swift::SourceFile*, swift::CodeCompletionCallbacksFactory*), (swift::RequestFlags)9>::callDerived<0ul, 1ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) const + 89
      20 swift-ide-test           0x000000010c91d560 swift::SimpleRequest<swift::CodeCompletionSecondPassRequest, bool (swift::SourceFile*, swift::CodeCompletionCallbacksFactory*), (swift::RequestFlags)9>::evaluateRequest(swift::CodeCompletionSecondPassRequest const&, swift::Evaluator&) + 32
      21 swift-ide-test           0x000000010c8fd13d llvm::Expected<swift::CodeCompletionSecondPassRequest::OutputType> swift::Evaluator::getResultUncached<swift::CodeCompletionSecondPassRequest>(swift::CodeCompletionSecondPassRequest const&) + 317
      22 swift-ide-test           0x000000010c8fcf7b llvm::Expected<swift::CodeCompletionSecondPassRequest::OutputType> swift::Evaluator::operator()<swift::CodeCompletionSecondPassRequest, (void*)0>(swift::CodeCompletionSecondPassRequest const&) + 43
      23 swift-ide-test           0x000000010c8e2639 swift::CodeCompletionSecondPassRequest::OutputType swift::evaluateOrDefault<swift::CodeCompletionSecondPassRequest>(swift::Evaluator&, swift::CodeCompletionSecondPassRequest, swift::CodeCompletionSecondPassRequest::OutputType) + 57
      24 swift-ide-test           0x000000010c8e25f0 swift::performCodeCompletionSecondPass(swift::SourceFile&, swift::CodeCompletionCallbacksFactory&) + 96
      25 swift-ide-test           0x000000010912e61d doCodeCompletionImpl(swift::CodeCompletionCallbacksFactory*, swift::CompilerInvocation const&, llvm::StringRef, llvm::StringRef, llvm::StringRef, bool)::$_0::operator()(swift::CompilerInstance&, bool) const + 141
      26 swift-ide-test           0x000000010912e57c void llvm::function_ref<void (swift::CompilerInstance&, bool)>::callback_fn<doCodeCompletionImpl(swift::CodeCompletionCallbacksFactory*, swift::CompilerInvocation const&, llvm::StringRef, llvm::StringRef, llvm::StringRef, bool)::$_0>(long, swift::CompilerInstance&, bool) + 76
      27 swift-ide-test           0x0000000109f6c908 llvm::function_ref<void (swift::CompilerInstance&, bool)>::operator()(swift::CompilerInstance&, bool) const + 88
      28 swift-ide-test           0x0000000109f6cbef swift::ide::CompletionInstance::performNewOperation(llvm::Optional<llvm::hash_code>, swift::CompilerInvocation&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, llvm::MemoryBuffer*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, swift::DiagnosticConsumer*, llvm::function_ref<void (swift::CompilerInstance&, bool)>) + 623
      29 swift-ide-test           0x0000000109f6d60e swift::ide::CompletionInstance::performOperation(swift::CompilerInvocation&, llvm::ArrayRef<char const*>, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, llvm::MemoryBuffer*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, swift::DiagnosticConsumer*, llvm::function_ref<void (swift::CompilerInstance&, bool)>) + 670
      30 swift-ide-test           0x000000010912e2d2 doCodeCompletionImpl(swift::CodeCompletionCallbacksFactory*, swift::CompilerInvocation const&, llvm::StringRef, llvm::StringRef, llvm::StringRef, bool) + 1090
      31 swift-ide-test           0x0000000109103b61 doConformingMethodList(swift::CompilerInvocation const&, llvm::StringRef, llvm::StringRef, llvm::StringRef, bool, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >) + 545
      32 swift-ide-test           0x00000001090fed83 main + 8435
      33 libdyld.dylib            0x00007fff2037b621 start + 1
      34 libdyld.dylib            0x0000000000000006 start + 18446603339975641574
      Abort trap: 6
       

        Attachments

          Activity

            People

            Assignee:
            rwidmann Robert Widmann
            Reporter:
            nathawes Nathan Hawes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: