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

Adopt ‘as’ bridging on Linux. #1526

Merged
merged 1 commit into from
May 31, 2018
Merged

Adopt ‘as’ bridging on Linux. #1526

merged 1 commit into from
May 31, 2018

Conversation

millenomi
Copy link
Contributor

This patch adopts 'as' bridging on Linux. It requires swiftlang/swift#16022 — see that PR for more details.

@@ -476,7 +476,7 @@ open class NSAffineTransform : NSObject, NSCopying, NSSecureCoding {
}
}

extension AffineTransform : _ObjectTypeBridgeable {
extension AffineTransform : _ObjectiveCBridgeable {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main change is removing the parallel type _ObjectTypeBridgeable and replacing it with the newly-exposed-on-Linux _ObjectiveCBridgeable.

@@ -1378,3 +1378,14 @@ extension POSIXError {
/// Interface output queue is full.
public static var EQFULL: POSIXError.Code { return .EQFULL }
}

public // COMPILER_INTRINSIC
func _convertNSErrorToError(_ error: NSError?) -> Error {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converting Error to NSError and back is in scope, but support is WIP.

@parkera
Copy link
Contributor

parkera commented Apr 19, 2018

Ultimately we should also change NSJSONSerialization to create the NS types to finally fix the NSNumber casting problem described in the forum post. I think it can be a follow-up to this though.

NSPropertyListSerialization can probably lose its eager conversion as well.

@millenomi millenomi changed the title [WIP] Adopt ‘as’ bridging on Linux. Adopt ‘as’ bridging on Linux. May 17, 2018
@parkera
Copy link
Contributor

parkera commented May 17, 2018

Looks good!

@millenomi
Copy link
Contributor Author

@swift-ci please test and merge

@benlangmuir
Copy link
Contributor

The corresponding compiler change in had to be reverted.

@benlangmuir
Copy link
Contributor

I canceled the "and merge" build in CI so that this wouldn't be automatically merged. I think the underlying linux test will continue though.

@millenomi
Copy link
Contributor Author

On hold as we figure out the 14.04 issues on the compiler patch.

@millenomi
Copy link
Contributor Author

Please test with the following:
swiftlang/swift#16736

@swift-ci please test

@millenomi
Copy link
Contributor Author

Please test with the following:
swiftlang/swift#16736

@swift-ci please test

@millenomi
Copy link
Contributor Author

Please test with the following:
swiftlang/swift#16736

@swift-ci please test

@millenomi
Copy link
Contributor Author

Simultaneous merging with swiftlang/swift#16736 imminent…

} else {
return _SwiftValue(value)
return (value as AnyObject) as! NSObject
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this change leads to crash in cases like this:

class A {}
let array: NSArray = [A()]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants