Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ahoppen opened this issue Jul 7, 2021 · 1 comment
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. found by stress tester Flag: An issue found by the SourceKit stress tester

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Jul 7, 2021

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 {}
}
@hborla
Copy link
Member

hborla commented Sep 2, 2021

Fixed by #39124

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. found by stress tester Flag: An issue found by the SourceKit stress tester
Projects
None yet
Development

No branches or pull requests

2 participants