Nullability changes in AppKit APIs are missed by Xcode

Originator:tony
Number:rdar://32997427 Date Originated:27-Jun-2017 14:31
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 9.0 beta 2 (9M137d) / macOS 10.12.5 (16F73)
Classification:Other Bug Reproducible:Always
 
Summary:
I’m really not sure if this is an AppKit issue, or an Xcode issue, so bear with me.

In macOS 10.12, NSNib had the following method:

open func instantiate(withOwner owner: Any?, topLevelObjects: AutoreleasingUnsafeMutablePointer<NSArray>?) -> Bool

In macOS 10.13, that method is now:

open func instantiate(withOwner owner: Any?, topLevelObjects: AutoreleasingUnsafeMutablePointer<NSArray?>?) -> Bool

Note the changed optionality of the NSArray instance.




Steps to Reproduce:
1. Open the attached sample project, specifically the included `NSNib.swift`
2. Compile the project

Expected Results:
There is some way of handling optionality changes in the SDK, much like there is with new/changed method, parameter and class naming changes.

Actual Results:
There’s no way to have Swift code that compiles this example on both Xcode 8 and Xcode 9.

Version:
Xcode 9.0 beta 2 (9M137d) / macOS 10.12.5 (16F73)

Notes:

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!