[swift-corelibs-dev] NSCoding methods
Philippe Hausler
phausler at apple.com
Sat Dec 26 20:54:34 CST 2015
> On Dec 26, 2015, at 3:33 PM, Luke Howard <lukeh at padl.com> wrote:
>
>
>> On 27 Dec 2015, at 3:45 AM, Philippe Hausler <phausler at apple.com> wrote:
>>
>> Totally reasonable since that is a limitation that will cause subclassers to not be able to implement that even outside of Foundation.
>>
>> What would help most for unit testing what you have so far?
>>
>> I have a few init?(coder:) implementations that should match the implementations on darwin; primarily I was focused on getting the plist types done first and then moving onto the other classes.
>
> I’ve done the plist classes and a few others such as NSURL, NSLocale, NSUUID. I’m going to look at the rest today, other remaining todos are:
>
> * encodeValueOfObjCType()
> * reviewing fatal vs non-fatal error cases
> * testing reading/writing from a stream (vs memory), seem to be some issues with this
> * unit tests
> * incremental decoding (probably will not get to this)
>
> Also I’m only looking at NSKeyedArchiver – do we need to support NSArchiver?
>
> Finally, I filed a few bugs (with patches) for things I bumped into along the way:
>
> * SR-378: Uninitialised memory in NSDictionary initialiser
> * SR-379: CFDictionaryGetKeysAndValues() bridges in wrong order
> * SR-380: Occasional crashes in NSString.hash.getter
> * SR-381: Request for API to return mangled nominal type name
> * SR-386: NSLog() API
>
> — Luke
I was looking over some of the init and encode methods you have, there are a few bits that might need some touch ups to match behavioral differences but I think I can probably merge in some of the work I have done as an addendum to what you have already gotten done.
It might be good for review side of things to break out those other issues into their own pull requests. Is there a reason to implement NSLog and not just use print?
SR-380; that is a compiler issue? or runtime?
NSArchiver is old and not very cross platform on the darwin side of things anyhow. I think we should just focus on NSCoder/NSKeyedArchiver and user subclasses of each case.
Have you tested yet on ubuntu?
More information about the swift-corelibs-dev
mailing list