CloudKit's database fetchAll methods are missing annotations on Swift 3

Originator:oscar
Number:rdar://26977470 Date Originated:2016-06-23
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification:Serious Bug Reproducible:Always
 
Summary:
Using CloudKit with Swift 3, if you try to fetch all records from the database, using the fetchAll(_:) methods make the compiler choke because they're not correctly type-annotated.

Steps to Reproduce:
1. Instantiate an iCloud Database
2. Try to fetch all Record Zones or Subscriptions from the database using the `fetchAll(_:)` methods.


Expected Results:
The compiler correctly identifies which of the two methods you're using and infers the completionHandler's parameters types.

Actual Results:
The compiler doesn't know which `fetchAll` variant you're using, if either the one that fetches Record Zones or the one that fetches Subscriptions. You can fix it by explicitly declaring the parameters' type yourself:

db.fetchAll { (zones: [CKRecordZone]?, error) in
    // ...
}

To me, this is a clear example where the API design guidelines are not being respected, favoring brevity over clarity.

Version:
Xcode 8 b1

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!