[swift-users] Linux Swift: Strange bug found in a simple arithmetic

Ole Begemann ole at oleb.net
Wed Sep 7 10:47:47 CDT 2016


> Also hoping someone more knowledgeable can explain why these seemingly
> simple cases do in fact take so long! :)

Matt Gallagher wrote an excellent article where he explained how 
seemingly simple expressions can sometimes cause an enormous amount of 
work for the type checker because it has so many overloads to consider:

   "Exponential time complexity in the Swift type checker"
   http://www.cocoawithlove.com/blog/2016/07/12/type-checker-issues.html

It's a great read.

For what it's worth, on my Mac with Xcode 8b6 the snippet takes about 3 
seconds to compile (which is still a long time).

Ole


More information about the swift-users mailing list