Skip to content

[SR-3667] Crash in CharacterSet #4295

Open
@swift-ci

Description

@swift-ci
Previous ID SR-3667
Radar None
Original Reporter aamctustwo (JIRA User)
Type Bug

Attachment: Download

Environment

Xcode 8.2
macOS 10.12.2

Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Bug, RunTimeCrash
Assignee None
Priority Medium

md5: 6883edae0bb5e9e44b987df04957b303

Issue Description:

There is a crash in the CharacterSet implementation. See the example below. I've attached a Playground with this issue and a screenshot of the error.

import Foundation

extension CharacterSet {
    func isSuperset(ofCharactersIn string: String) -> Bool {
        let otherSet = CharacterSet(charactersIn: string)
        return isSuperset(of: otherSet)
    }
}

let foo = "_"

let bar = CharacterSet.alphanumerics.union(CharacterSet(charactersIn: foo))

print(bar.isSuperset(ofCharactersIn: foo))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions