Either runtime should handle casting from [T?] to [T] or compiler should report error

Originator:an00na
Number:rdar://20702174 Date Originated:26-Apr-2015 01:20 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 1.2
Classification:Crash/Hang/Data Loss Reproducible:Not Applicable
 
Summary:
Currently, Swift runtime can not handle casting from [T?] to [T] and throws fatal error. Please notice it is not an unwrapping nil error(which runtime should catch, correctly) but a type casting error.

Ideally, runtime should be able to handle this kind of casting. Before that, it is the compiler’s job to catch it during compilation.

Sample code: http://cl.ly/3N3R2I3g0F1e

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!