[swift-users] Linux Swift: Strange bug found in a simple arithmetic
lzell11 at gmail.com
Wed Sep 7 09:44:47 CDT 2016
> It's certainly an interesting compiler issue, probably to do with the type
I've for sure hit this before and now see with a little help to the
compiler the compile time drops dramatically:
Float(abs(Double(0) - Double(0)))
repl.swift:50:1: error: expression was too complex to be solved in
reasonable time; consider breaking up the expression into distinct
Float(abs(Double(0 as Int) - Double(0 as Int)))
// Compiles instantly!
It makes the code ugly though, so we're probably better-off busting it into
subexpressions like the error above states.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users