Swift: Asymmetric optional testing
| Originator: | raphael | ||
| Number: | rdar://17375253 | Date Originated: | 19-Jun-2014 09:53 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6 Beta2 |
| Classification: | Enhancement | Reproducible: | Not Applicable |
Summary: This simple code should work out of the box. If == works, != should work too. ===== /* why asymmetric testing for nil equality with implictly unwrapped optionals? */ let mystr :String! = "hello" let testIsNotNil :Bool = (mystr != nil) let testIsNil :Bool = (mystr == nil) // error =====
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!