-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Re-enable NSCoder encodeInt/decodeInt in Swift #3663
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
Conversation
…en in Swift, throws runtime exception
|
@swift-ci Please test and merge |
|
Thanks Tony |
|
Thank you for finding this and letting me know! |
|
Did this fix land in the swift version as of xcode beta 4? Apple Swift version 3.0 (swiftlang-800.0.41.2 clang-800.0.36) |
|
No, Xcode beta 4 used about the same version of the overlay as beta 3 did, due to the numerous pending changes in swift's master branch between the two. This change will be in the next beta, or you can try it out with the daily snapshots (that would be a great way to verify). |
|
Ok I'll wait for the next beta then, thanks |
|
Doesn't look like the fix is in xcode beta 5. Tony, can you confirm? Apple Swift version 3.0 (swiftlang-800.0.42.1 clang-800.0.36.1) |
|
I'm not sure at this point; the change is clearly in the swift-3.0-branch so I'm not sure why it's not making it into the seeds. Can you double check with a swift 3 snapshot? |
|
Beta 5 has the same compiler and overlays as 4, for the most part. You should be able to try a snapshot toolchain from swift.org, though. |
|
Ah ok - that would explain why the beta 4 -> beta 5 migration did not require any corresponding changes on my side this time. Thanks, I suspected I had a bad installation at first. |
|
Verified fixed in beta 6 with the new encodeCInt methods, thanks. Apple Swift version 3.0 (swiftlang-800.0.43.6 clang-800.0.38) |
[pull] swiftwasm from main
What's in this pull request?
When we worked on the first version of naming fixes to the automatic import into Swift, we chose to make
-[NSCoder encodeInt:forKey:]unavailable, to avoid a conflict with-[NSCoder encodeInt32:forKey:], as they would end up with the same name in Swift.However, if you wish to subclass
NSCoderin Swift, then you have to override this method. If it is unavailable, then you cannot do so, and if anyone that is encoded using this coder calls it,NSCoderwill throw an exception. These methods are abstract in that class:Therefore, we are bringing the method back, but with a slightly different name to resolve the ambiguity.
Import the C integer primitive encode and decode methods as:
This will join the existing family of methods:
We did not choose to rename
IntegertoIntin our APIs for coding.We will continue to make these two functions unavailable on
NSKeyedArchiverandNSKeyedUnarchiver, to avoid confusion with the other encode/decode methods that use integers.Resolved bug number:
rdar://problem/27425997
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
A smoke test on macOS does the following:
device standard libraries are not built.
version of these tests are not run.
A smoke test on Linux does the following:
tests are not run.
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.