-
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
[SR-7865] swift-corelibs-foundation does not compile on macOS after 'as' bridging was merged #1579
Conversation
@swift-ci please test |
cc @spevans |
Did the tests work in Xcode? I made the same basic change but some of the tests for NSJSONSerialization failed with issues converting some nil and Optional<Any> values.
… On 4 Jun 2018, at 15:39, Lily Vulcano ***@***.***> wrote:
The new primitives are only available if Objective-C isn't. Guard them with #canImport(ObjectiveC).
Resolves SR-7865.
You can view, comment on, or merge this pull request online at:
#1579
Commit Summary
Guard the use of the new stdlib primitives with #canImport(ObjectiveC).
File Changes
M Foundation/Bridging.swift (7)
M Foundation/NSError.swift (5)
Patch Links:
https://github.com/apple/swift-corelibs-foundation/pull/1579.patch
https://github.com/apple/swift-corelibs-foundation/pull/1579.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ignore that last message, I see now that your change is different to what I tried.
… On 4 Jun 2018, at 15:39, Lily Vulcano ***@***.***> wrote:
The new primitives are only available if Objective-C isn't. Guard them with #canImport(ObjectiveC).
Resolves SR-7865.
You can view, comment on, or merge this pull request online at:
#1579
Commit Summary
Guard the use of the new stdlib primitives with #canImport(ObjectiveC).
File Changes
M Foundation/Bridging.swift (7)
M Foundation/NSError.swift (5)
Patch Links:
https://github.com/apple/swift-corelibs-foundation/pull/1579.patch
https://github.com/apple/swift-corelibs-foundation/pull/1579.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@millenomi @spevans Can we have this merged please? |
I forgot to run tests in Xcode; once I do today. |
…y as AnyObject casts on Darwin, and move all code back to _SwiftValue.store/fetch.
@swift-ci please test |
Here's what I found:
The solution is to prevent usage of This patch isn't done; we need to make sure that objects passed in by an author work, and to this extent I need to make |
After some experimentation: we can just return the native box from |
…win by `as AnyObject`.
@swift-ci please test |
This addresses the latter point. |
cc @spevans |
Confirmed working on 2018-06-04 toolchain (macOS 10.13.5, Xcode 9.4) and Ubuntu 16.04. |
@swift-ci please test |
It’s breaking the SwiftPM build. |
Investigating. |
I cannot reproduce locally. Triggering a new build here in case it was transient. |
@swift-ci please test |
Found the issue: We are implementing NSNull roundtrip in let x: [Int?] = [nil]
print((x as [AnyObject]) as [Any]) // -> [<null>]
print(((x as [AnyObject]) as [Any]).map { type(of: $0) }) // -> [NSNull] Since bridging already works on both platforms to unpack it in that case, we may want to stop explicitly unpacking it in our case. However, we need to figure out how to treat |
I'm going to check if us not unpacking is enough to let things be unblocked while we work on a longer term solution (which hinges on whether we desire SCF to be used on Darwin as a general purpose library or not). |
@swift-ci please test |
The new primitives are only available if Objective-C isn't. Guard them with
#canImport(ObjectiveC)
.(Additionally, see below for discussion.)
Resolves SR-7865.