Xcode-7-beta.6 (7A192o): XCTAssertNil allows non-optional values, then crashes
| Originator: | segiddins | ||
| Number: | rdar://22409527 | Date Originated: | 24-Aug-2015 03:25 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-7-beta.6 (7A192o) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
XCTAssertNil allows non-optional values, then crashes in _swift_getClass
Steps to Reproduce:
import Foundation
import XCTest
class C : NSObject {
dynamic var o = NSObject()
}
class T: XCTestCase {
func testC() {
XCTAssertNil(C().o)
}
}
Expected Results:
Should fail to compile, as a non-optional property should never be nil.
Actual Results:
But totally compiles and dereferences NULL at runtime.
Regression:
Worked fine prior to beta 6
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!