Skip to content

[SR-8987] Assertion failure in isViableOverloadSet: (hasParameters()), function getParameters, file swift/lib/Sema/CalleeCandidateInfo.h, line 120 #51491

@nathawes

Description

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

md5: d4205190b9a1ff4f6479f25ae26d7599

Issue Description:

To reproduce checkout and open the Chatto workspace:

$ git clone https://github.com/badoo/Chatto.git
$ cd Chatto
$ git checkout -f 3e4b1a7167b066b1472fe217778461f9d7bd46fd
$ open Chatto.xcworkspace 

Then in Xcode:

  1. Select the October 3, 2018 dev snapshot toolchain

  2. Navigate to BaseChatViewController+Changes.swift

  3. Replace lines 268-275 inside createModelUpdates with the below:
    let changes = Chatto.generateChanges(oldCollection &

  4. Build to see the assertion failure below.

Application Specific Information:
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-10-03-a.xctoolchain/usr/bin/swift -frontend -c ... 
1.  While type-checking 'createModelUpdates(newItems:oldItems:collectionViewWidth:)' at /Users/nhawes/Desktop/xfails/Chatto/Chatto/Source/ChatController/BaseChatViewController+Changes.swift:266:13
2.  While type-checking statement at [/Users/nhawes/Desktop/xfails/Chatto/Chatto/Source/ChatController/BaseChatViewController+Changes.swift:266:200 - line:269:5] RangeText="{
        let newDecoratedItems = self.chatItemsDecorator?.decorateItems(newItems) ?? newItems.map { DecoratedChatItem(chatItem: $0, decorationAttributes: nil) }
        let changes = Chatto.generateChanges(oldCollection &
    "
3.  While type-checking declaration 0x7fcb820aad28 at /Users/nhawes/Desktop/xfails/Chatto/Chatto/Source/ChatController/BaseChatViewController+Changes.swift:268:9
4.  While type-checking expression at [/Users/nhawes/Desktop/xfails/Chatto/Chatto/Source/ChatController/BaseChatViewController+Changes.swift:268:23 - line:268:60] RangeText="Chatto.generateChanges(oldCollection "
 
Assertion failed: (hasParameters()), function getParameters, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/Sema/CalleeCandidateInfo.h, line 120.
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff590e1b86 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff59197c50 pthread_kill + 285
2   libsystem_c.dylib               0x00007fff5904b268 __abort + 144
3   libsystem_c.dylib               0x00007fff5904b1d8 abort + 142
4   libsystem_c.dylib               0x00007fff59013868 __assert_rtn + 320
5   swift                           0x00000001109afdc9 isViableOverloadSet(swift::CalleeCandidateInfo const&, unsigned long) + 585
6   swift                           0x00000001109ad4bc (anonymous namespace)::FailureDiagnosis::visitApplyExpr(swift::ApplyExpr*) + 6636
7   swift                           0x00000001109925a6 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 86
8   swift                           0x0000000110a30d07 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 1319
9   swift                           0x00000001109ed3e8 swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 72
10  swift                           0x0000000110a8be37 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 951
11  swift                           0x0000000110a90f85 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, bool) + 357
12  swift                           0x0000000110a91261 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int, bool) + 273
13  swift                           0x0000000110aa77e5 validatePatternBindingEntries(swift::TypeChecker&, swift::PatternBindingDecl*) + 757
14  swift                           0x0000000110a9fcd4 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 884
15  swift                           0x0000000110a9f956 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
16  swift                           0x0000000110b19243 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 451
17  swift                           0x0000000110b18578 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 136
18  swift                           0x0000000110b17114 swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 260
19  swift                           0x0000000110b17c4f swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 271
20  swift                           0x0000000110b38133 typeCheckFunctionsAndExternalDecls(swift::SourceFile&, swift::TypeChecker&) + 339
21  swift                           0x0000000110b3928d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 2061
22  swift                           0x00000001107daa35 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 629
23  swift                           0x00000001107da038 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 616
24  swift                           0x000000010fb14067 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1335
25  swift                           0x000000010fb12a9d swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3021
26  swift                           0x000000010fac4f0e main + 686
27  libdyld.dylib                   0x00007fff58fa3085 start + 1

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions