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

Assertion failed: (numMissing > 0 || numExtra > 0 || numWrong > 0), function diagnoseArgumentLabelError

    XMLWordPrintable

    Details

      Description

      Compile the below to reproduce:

      extension Dictionary {
          static func fromArray<K, V>(_ arrayOfTuples: [(K, V)]) -> [K:V] {}
      
          func flatMapDict<MK, MV>(transform: (Key, Value) -> (Int, Int)) -> [MK: MV] {
              return Dictionary.fromArray(
                  compactMap {
                      let (k, v) = transform($0
      

      Also crashes sourcekit.

      Trace:

      Assertion failed: (numMissing > 0 || numExtra > 0 || numWrong > 0), function diagnoseArgumentLabelError, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/Sema/MiscDiagnostics.cpp, line 1779.
       
      
      Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
      0   libsystem_kernel.dylib        	0x00007fff6b42d33a __pthread_kill + 10
      1   libsystem_pthread.dylib       	0x00007fff6b4e9e60 pthread_kill + 430
      2   libsystem_c.dylib             	0x00007fff6b3b48a2 __abort + 139
      3   libsystem_c.dylib             	0x00007fff6b3b4817 abort + 135
      4   libsystem_c.dylib             	0x00007fff6b3b3ac6 __assert_rtn + 314
      5   swift                         	0x0000000107b74803 swift::diagnoseArgumentLabelError(swift::ASTContext&, swift::Expr*, llvm::ArrayRef<swift::Identifier>, bool, swift::InFlightDiagnostic*) (.cold.1) + 35
      6   swift                         	0x0000000104234ebd swift::diagnoseArgumentLabelError(swift::ASTContext&, swift::Expr*, llvm::ArrayRef<swift::Identifier>, bool, swift::InFlightDiagnostic*) + 4157
      7   swift                         	0x00000001041b042b swift::constraints::LabelingFailure::diagnoseAsError() + 171
      8   swift                         	0x00000001041a3833 swift::constraints::RelabelArguments::diagnose(swift::constraints::Solution const&, bool) const + 67
      9   swift                         	0x000000010410e8f1 swift::constraints::ConstraintSystem::applySolutionFixes(swift::constraints::Solution const&) + 1889
      10  swift                         	0x000000010410f17d swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::constraints::SolutionApplicationTarget) + 61
      11  swift                         	0x000000010428a6fd swift::TypeChecker::typeCheckExpression(swift::constraints::SolutionApplicationTarget&, bool&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 557
      12  swift                         	0x000000010428aad8 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int) + 120
      13  swift                         	0x000000010428ad63 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int, swift::Type) + 371
      14  swift                         	0x00000001043316f1 swift::PatternBindingEntryRequest::evaluate(swift::Evaluator&, swift::PatternBindingDecl*, unsigned int) const + 641
      15  swift                         	0x000000010435ef35 llvm::Expected<swift::PatternBindingEntryRequest::OutputType> swift::Evaluator::getResultUncached<swift::PatternBindingEntryRequest>(swift::PatternBindingEntryRequest const&) + 357
      16  swift                         	0x000000010435ec93 llvm::Expected<swift::PatternBindingEntryRequest::OutputType> swift::Evaluator::getResultCached<swift::PatternBindingEntryRequest, (void*)0>(swift::PatternBindingEntryRequest const&) + 51
      17  swift                         	0x000000010435c348 swift::PatternBindingEntryRequest::OutputType swift::evaluateOrDefault<swift::PatternBindingEntryRequest>(swift::Evaluator&, swift::PatternBindingEntryRequest, swift::PatternBindingEntryRequest::OutputType) + 40
      18  swift                         	0x00000001042bd35f swift::ASTVisitor<(anonymous namespace)::DeclChecker, void, void, void, void, void, void>::visit(swift::Decl*) + 2703
      19  swift                         	0x00000001042bc0ef (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 159
      20  swift                         	0x00000001042bc032 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 130
      21  swift                         	0x000000010432bc6a swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 2426
      22  swift                         	0x00000001043291c0 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 128
      23  swift                         	0x0000000104328fae swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 286
      24  swift                         	0x000000010410f3d9 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::constraints::SolutionApplicationTarget) + 665
      25  swift                         	0x000000010428a6fd swift::TypeChecker::typeCheckExpression(swift::constraints::SolutionApplicationTarget&, bool&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 557
      26  swift                         	0x000000010428a437 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 87
      27  swift                         	0x000000010432c923 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 5683
      28  swift                         	0x000000010432ce80 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::Stmt>(swift::Stmt*&) + 128
      29  swift                         	0x000000010432bd30 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 2624
      30  swift                         	0x00000001043291c0 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 128
      31  swift                         	0x0000000104328671 swift::TypeCheckFunctionBodyRequest::evaluate(swift::Evaluator&, swift::AbstractFunctionDecl*) const + 1089
      32  swift                         	0x000000010432fb16 llvm::Expected<swift::TypeCheckFunctionBodyRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckFunctionBodyRequest>(swift::TypeCheckFunctionBodyRequest const&) + 598
      33  swift                         	0x000000010432f64c llvm::Expected<swift::TypeCheckFunctionBodyRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckFunctionBodyRequest, (void*)0>(swift::TypeCheckFunctionBodyRequest const&) + 316
      34  swift                         	0x000000010432f4b6 llvm::Expected<swift::TypeCheckFunctionBodyRequest::OutputType> swift::Evaluator::operator()<swift::TypeCheckFunctionBodyRequest, (void*)0>(swift::TypeCheckFunctionBodyRequest const&) + 118
      35  swift                         	0x0000000104327ef5 swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType) + 37
      36  swift                         	0x0000000104327ea0 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 64
      37  swift                         	0x000000010435bd4e swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 382
      38  swift                         	0x000000010435ca65 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest>(swift::TypeCheckSourceFileRequest const&) + 453
      39  swift                         	0x000000010435c784 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckSourceFileRequest, (void*)0>(swift::TypeCheckSourceFileRequest const&) + 52
      40  swift                         	0x000000010435c6f6 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::operator()<swift::TypeCheckSourceFileRequest, (void*)0>(swift::TypeCheckSourceFileRequest const&) + 118
      41  swift                         	0x000000010435bae0 swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType) + 32
      42  swift                         	0x00000001036cc78a swift::CompilerInstance::forEachFileToTypeCheck(llvm::function_ref<void (swift::SourceFile&)>) + 90
      43  swift                         	0x00000001036cc67a swift::CompilerInstance::performSema() + 74
      44  swift                         	0x00000001035eee19 performCompile(swift::CompilerInstance&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 2329
      45  swift                         	0x00000001035ed519 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3529
      46  swift                         	0x0000000103589ccd main + 861
      47  libdyld.dylib                 	0x00007fff6b2e5cc9 start + 1
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: