Optional Type Matching bug

Originator:an00na
Number:rdar://22218574 Date Originated:10-Aug-2015 04:09 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Swift 2.0 beta 5
Classification:Serious Bug Reproducible:Always
 
let a: Int? = nil
let b: Int = 1
a == b // picks `==(lhs: T, rhs: T)` over `==(lhs: T?, rhs: T)` and causes unwrapping of nil.

Read the comments of sample code to see the details.

Sample code: http://cl.ly/371O1z2w2a2W

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!