Swift compatibility for NSAppleScript
| Originator: | joseph.m.mclaughlin | ||
| Number: | rdar://23459176 | Date Originated: | 11/09/15 |
| Status: | Open | Resolved: | |
| Product: | OS X SDK | Product Version: | Xcode 7.1 |
| Classification: | Enhancement | Reproducible: |
Summary: Although `executeAndReturnError(errorInfo:)` and `executeAppleEvent(event:errorInfo:)` can return `nil`, they aren't marked as having a `_Nullable` return type. This prevents using `if let` and `guard` statements and instead requires checking the `errorInfo` dictionary to avoid crashing. Expected Results: `executeAndReturnError(errorInfo:)` and `executeAppleEvent(event:errorInfo:)` should both have a return type of `NSAppleEventDescriptor * _Nullable`. Actual Results: `executeAndReturnError(errorInfo:)` and `executeAppleEvent(event:errorInfo:)` both have a return type of `NSAppleEventDescriptor *` (_Nonnull). Version: Xcode 7.1 Notes: As noted above, this is an enhancement, as the current `errorInfo` parameter can be used to check if the function(s) completed successfully before accessing the resulting variable.
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!