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-3688] String.rangeOfCharacter(from:) Produces Incorrect Result on Linux #4292

Closed
swift-ci opened this issue Jan 20, 2017 · 2 comments
Closed

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-3688
Radar None
Original Reporter aamctustwo (JIRA User)
Type Bug
Status Closed
Resolution Duplicate
Environment

macOS: 10.12
Xcode: 8.2

Linux: Ubuntu 16.04
swift-3.0.2-RELEASE

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

md5: 544128dd1cfc4c602f55a88818ed71d8

is duplicated by:

  • SR-3825 CharacterSet union not working correctly on linux

Issue Description:


import Foundation

let foo = "_"

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

let baz = foo.rangeOfCharacter(from: bar.inverted)

let qux = (baz == nil)

print("baz: \(baz as Any)")

// On macOS this prints `true` and on Linux this prints `false`.
print("qux: \(qux)")
@swift-ci
Copy link
Contributor Author

Comment by Aaron McTavish (JIRA)

May be related to SR-3485?

@swift-ci
Copy link
Contributor Author

Comment by Matt Rajca (JIRA)

You get different results on Linux because the union produces incorrect results (you'll notice bar.containsString(foo) returns false when it should return true).

Duplicate of https://bugs.swift.org/browse/SR-3825.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant