NSURLRequest without NSURL crashes Swift
| Originator: | getaaron | ||
| Number: | rdar://18987481 | Date Originated: | 11/14/2014 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | iOS 8.1 GM |
| Classification: | Reproducible: | Always |
Summary: Creating an NSURLRequest without an accompanying NSURL violates Swift's safety guarantee. Steps to Reproduce: Run this code: let request = NSURLRequest(); println(request.URL) Expected Results: Either `URL` should be an optional type, since it is `nil` in this case, or the non-designated initializer `NSURLRequest()` should cause an error in Swift. Actual Results: Swift's guarantee that objects exist if they aren't optional is broken. This code crashes. Version: iOS 8.1 GM
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!