Skip to content

[SR-14894] Assertion failed: (!empty()) in ConstraintSystem::repairFailures #57241

Closed
@ahoppen

Description

@ahoppen
Previous ID SR-14894
Radar rdar://80271707
Original Reporter @ahoppen
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, FoundByStressTester
Assignee None
Priority Medium

md5: 19b18351716ffb7dd45615ec21474275

is duplicated by:

  • SR-15112 Assertion failed: (!empty()), function back, file SmallVector.h in ConstraintSystem::repairFailures

Issue Description:

The following test case hits an assertion failure !empty() in ConstraintSystem::repairFailures.

If a type annotation (icon: Category) is added to the closure parameter, the crash no longer happens.

// RUN: %sourcekitd-test -req=complete -pos=8:28 %s -- %s -sdk /Applications/Xcode-GPE.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -target arm64-apple-ios13.0

import SwiftUI

struct UserListFormView {
    @ViewBuilder var body: some View {
        let icons: [Category]
        ForEach(icons.map{ $0 }) { icon in
            Image(icon)
                .sag(icon)
        }
    }
}

enum Category: String {
    case housewares
}

extension View {
    func sag<V>(_ tag: V) -> some View where V : Hashable {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.found by stress testerFlag: An issue found by the SourceKit stress tester

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions