<p dir="ltr"></p>
<p dir="ltr">Sent from Alto</p>
</br><hr style="border:0;height:1px;color:#999;background-color:#999;width:100%;margin:0 0 9px 0;padding:0;"><span style="font-size:14px; color:#999999;">On Tuesday, 20 September 2016 Jordan Rose via swift-users <<span style="color:#0000A0">swift-users@swift.org</span>> wrote:</span><br></br>C represents pointers the other way around; that declaration says only the outer pointer is nullable. There are two things going on here:<br /><br />- Swift 2 made all pointers implicitly nullable, without using an optional type. Swift 3 makes that explicit.<br />- Swift 2 had a bug that assumed that all pointers-to-references were optional, instead of just those without nullability annotations. Swift 3 "fixes" that…but that reveals places where headers used _Nonnull to mean "always produces a nonnull pointer", forgetting that it also applies to input.<br /><br />If this is an API in CloudKit itself, please file a Radar at bugreport.apple.com. If it's a third-party library built on CloudKit, you'll have to report the issue to them.<br /><br />Sorry for the trouble!<br />Jordan<br /><br /><br />> On Sep 20, 2016, at 10:32, Michael Gardner via swift-users <swift-users@swift.org> wrote:<br />> <br />> I'm using an Objective-C library that has me provide a callback that takes a double-pointer parameter like this, where only the inner pointer is nullable:<br />> <br />> CKRecord *_Nonnull *_Nullable inOutRecordPtr<br />> <br />> Swift 2 imported this as an AutoreleasingUnsafeMutablePointer<CKRecord?>, as expected. However, Swift 3 is importing it as AutoreleasingUnsafeMutablePointer<CKRecord>?, which breaks the library's API since there's no way to return a new record.<br />> <br />> Is this a Swift 3 bug, or am I missing something?<br />> _______________________________________________<br />> swift-users mailing list<br />> swift-users@swift.org<br />> https://lists.swift.org/mailman/listinfo/swift-users<br /><br />