Object subscripting should return an optional

Originator:gordon
Number:rdar://18428615 Date Originated:23-Sep-2014 02:18 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 1.0
Classification:Other Bug Reproducible:Not Applicable
 
Summary:
I thought this was the case at one point, but it object subscripting doesn’t return an optional. This seems crazy to me, since I have to imagine that’s a huge point of failure for most applications. Simply returning an optional would make the entire thing much safer. If general subscripting doesn’t return an optional (which I’d argue it should), then it would be great to at least have a safe function inside the standard lib to do this.

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!