-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
@@ -476,7 +476,7 @@ open class NSAffineTransform : NSObject, NSCopying, NSSecureCoding { | |||
} | |||
} | |||
|
|||
extension AffineTransform : _ObjectTypeBridgeable { | |||
extension AffineTransform : _ObjectiveCBridgeable { |
There was a problem hiding this comment.
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
.
Foundation/NSError.swift
Outdated
@@ -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 { |
There was a problem hiding this comment.
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.
Ultimately we should also change
|
Looks good! |
@swift-ci please test and merge |
The corresponding compiler change in had to be reverted. |
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. |
On hold as we figure out the 14.04 issues on the compiler patch. |
Please test with the following: @swift-ci please test |
Please test with the following: @swift-ci please test |
Please test with the following: @swift-ci please test |
Simultaneous merging with swiftlang/swift#16736 imminent… |
} else { | ||
return _SwiftValue(value) | ||
return (value as AnyObject) as! NSObject |
There was a problem hiding this comment.
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()]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@millenomi Can you look into this https://github.com/apple/swift-corelibs-foundation/pull/2500/files ?
This patch adopts 'as' bridging on Linux. It requires swiftlang/swift#16022 — see that PR for more details.