4 ms·
Following up with compile time of a few variations. let result:Double = -(1 + 1) + -(1 + 1) - 1 // 10.829s let result:Double = -(1 + 1) + -(1 + 1)
by ks2048 2y ago
Following up with compile time of a few variations.
let result:Double = -(1 + 1) + -(1 + 1) - 1 // 10.829s
let result:Double = -(1 + 1) + -(1 + 1) // 1.724s
let result:Double = (1 + 1) + (1 + 1) - 1 // 1.721s
let result:Double = -(1 + 1) - 1 // 0.763s
let result:Int = -(1 + 1) + -(1 + 1) - 1 // 0.571s
let result:Double = -(1 + 1) + -(1 + 1) + 1
//error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions