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-2509] CharacterSet.formUnion doesn't form a union on Linux #4453

Closed
swift-ci opened this issue Aug 28, 2016 · 2 comments
Closed

[SR-2509] CharacterSet.formUnion doesn't form a union on Linux #4453

swift-ci opened this issue Aug 28, 2016 · 2 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-2509
Radar None
Original Reporter tomquist (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

Linux ubuntu 4.2.0-36-generic #42-Ubuntu SMP Thu May 12 22:05:35 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
swift-DEVELOPMENT-SNAPSHOT-2016-08-26-a

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

md5: c1f7a6eb871c42037bb2c96ec9c5112b

Issue Description:

The following code should print true, but it prints false:

var charset = CharacterSet(charactersIn: "a")
charset.formUnion(CharacterSet(charactersIn: "A"))
print(charset.contains("A" as UnicodeScalar)) // false

however, the following woks:

var charset = CharacterSet(charactersIn: "a")
charset.insert(charactersIn: "A")
print(charset.contains("A" as UnicodeScalar))  // true
@swift-ci
Copy link
Contributor Author

Comment by David Friberg (JIRA)

The same behaviour is also present in for the union(: ) method of CharacterSet (Swift Ver. 3.0.2 @ Linux (x86_64); IBM Swift Sandbox)

E.g., for two CharacterSet instances, say a and b, the expression a.union(b) results in a, even if b is not a subset of a. Expected as union(: ) simply calls formUnion(: ).

Same reportee: but worth mentioning that this ticket is closely related to SR-2510, as the formUnion(: ) method of CharacterSet eventually calls the formUnion(with: ) method of NSMutableCharacterSet, via a closure supplied to _applyUnmanagedMutation(: ) of Foundation/Boxing.swift.

@swift-ci
Copy link
Contributor Author

Comment by Alexander Belonogov (JIRA)

This issue is fixed:
#1307

@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