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-6013] Segmentation fault while creating Set from Array inside an extension #48570

Closed
twostraws opened this issue Sep 27, 2017 · 0 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@twostraws
Copy link
Contributor

Previous ID SR-6013
Radar None
Original Reporter @twostraws
Type Bug
Status Resolved
Resolution Duplicate
Environment

Apple Swift version 4.0.1 (swiftlang-900.0.66 clang-900.0.37)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: a9de0452f30767b17f04ab9a7d7ab63a

duplicates:

  • SR-5934 Segmentation fault: 11 when creating a Set from an array of arrays

Issue Description:

The following code causes a segmentation fault:

extension Array {
    var isUnique: Bool {
        return self.count == Set(self).count
    }
}

The error is:

Stack dump:
0.  While emitting SIL for getter for isUnique at /var/folders/9n/4dpx4zb51qj9wc_fvxcv7_t00000gn/T/repl1-f3a44d..swift:2:13
[1]    18424 segmentation fault  swift

The problem goes away when the extension is restricted using "where Element: Hashable".

@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. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant