Xcode-beta (7A152u): Compiler traps under "release" build for the test target
| Originator: | owensd | ||
| Number: | rdar://21886510 | Date Originated: | 17-Jul-2015 11:10 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-beta (7A152u) |
| Classification: | Serious Bug | Reproducible: | Always |
The following function:
func testCorrectAnswer() {
let N = 8
let weight = 4
let oddWeight = 5
for var n = 0; n < N; n++ {
var balls: [Ball] = []
for i in 0..<N {
balls.append(Ball(weight: weight, index: i))
}
balls[n] = Ball(weight: oddWeight, index: n)
let found = findOddBallOutCorrectAnswer(balls)
let index = found?.index ?? -1
XCTAssertEqual(index, n)
}
}
Causes the compiler to trap under release mode when building for test.
Specifically, it is the “XCTAssertEqual(index, n)” line that is causing the issue.
I’ve attached the project.
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!