NSError API Bridged to Swift Incorrectly

Originator:wjk011
Number:rdar://21305050 Date Originated:June 9, 2015
Status:Open Resolved:
Product:OS X SDK Product Version:10.11 WWDC Seed
Classification:Other Bug Reproducible:Always
 
The NSError.setUserInfoValueProviderForDomain() API is incorrectly bridged to Swift 2.0 in Xcode build 7A120f. The return value for the block in this method is bridged as a non-nullable AnyObject, while the Objective-C header states that the return value is explicitly defined as a nullable AnyObject. This prevents me from using this API correctly under Swift.

Steps to Reproduce:
1. Install Xcode build 7A120f on OS X Yosemite build 14D136.
2. Open the playground attached.
3. Note the error message(s).

Expected Results:
The Swift playground should compile, and nil should be returned successfully from the block when it is called with any key.

Actual Results:
The playground does not compile, instead emitting one error.

Version:
Xcode build 7A120f on OS X build 14A136.

Configuration:
As far as I can tell, every time this API is used. Hardware: "MacBook Pro (Retina, 13-inch, Late 2013)" (as reported by About This Mac).

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!