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-457] Null and boolean CF constants are unbridged #4176

Open
lhoward opened this issue Jan 4, 2016 · 1 comment
Open

[SR-457] Null and boolean CF constants are unbridged #4176

lhoward opened this issue Jan 4, 2016 · 1 comment

Comments

@lhoward
Copy link
Contributor

lhoward commented Jan 4, 2016

Previous ID SR-457
Radar None
Original Reporter @lhoward
Type Bug

Attachment: Download

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

md5: 44891f5c40ee794a7aafe1e157827bc9

relates to:

  • SR-72 NSNumber is missing much parity

Issue Description:

On Darwin, kCFNull === NSNull(). Ditto kCFBooleanTrue/kCFBooleanFalse with their NSNumber equivalents.

For Swift Foundation, perhaps we need to bridge these (noting [SR-439]), or in the case of CFNull(), remove it entirely. Currently kCFBooleanTrue/kCFBooleanFalse are explicitly handled in _expensivePropertyListConversion() but that may not be the only place they escape from CF (or maybe it is – but I think it would be good to defensively avoid the kind of difficult-to-diagnose failures that could creep in if there are expectations that they are bridged).

I suppose if CoreFoundation APIs are not exported then the only risk is them escaping in objects such as property lists where CF is in charge.

NB: NSURL is the only direct consumer of kCFNull in Foundation I could find.

@Dante-Broggi
Copy link

The Core Foundation types / constants should get better Swift bridging. In the Xcode 9.4.1 toolchain, the constants are all IUOs and the types only have `var hashValue: Int`.

Or, just have the CF types become depreciated `typealiases` of their "NS" equivalents.

@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
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

2 participants