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-5404] Linux: Cannot cast NSData to Data #3838

Closed
tbkka opened this issue Jul 8, 2017 · 1 comment
Closed

[SR-5404] Linux: Cannot cast NSData to Data #3838

tbkka opened this issue Jul 8, 2017 · 1 comment

Comments

@tbkka
Copy link
Contributor

tbkka commented Jul 8, 2017

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

Ubuntu 14.04

swift-3.1.1-RELEASE-ubuntu14.04

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

md5: 5d6b5d63b6147d2d9f88d628f81598a7

duplicates:

  • SR-138 Foundation objects are not bridged on Linux as they are on OS X.

Issue Description:

On macOS, I seem to be able to consistently cast NSData objects to Data:

let n: NSData
let d = n as! Data

On Linux, this consistently fails at runtime. I've tried this with Swift 3.1.1 and a Swift 4 snapshot with the same results.

@belkadan
Copy link

We're trying very hard to avoid introducing this kind of bridging on Linux, since it makes the runtime more complicated and affects performance. But it is still a giant pitfall for writing cross-platform code right now.

@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

2 participants