Go Home Swift Compiler, You’re Drunk
spin.atomicobject.com
spin.atomicobject.com
EDIT: To be clear, addressing these kinds of issues is something we've been aggressively pursuing for Swift 3, and will continue to do so.
https://github.com/apple/swift/commit/2cdd7d64e1e2add7bcfd54...
I thought they fixed this, though. I filed it for Array<Array<Int>> long ago, and they patched that case. https://twitter.com/kongtomorrow/status/565844856690339841
Yes, the type inference in this case could use some improvement -- maybe guess the simplest possible interpretation first, and search the space of alternatives in the background, assuming there's a mechanism to go back for a do-over if any are eventually found...?
[1] https://en.wikipedia.org/wiki/Entscheidungsproblem
[2] https://en.wikipedia.org/wiki/Boolean_satisfiability_problem
Now take XCode, that is some real drunk.
https://www.reddit.com/r/programming/comments/4givdg/go_home...
"edit: for the code, it's just changing let myCompany to
let myCompany: [String: [String: [String: String]]]'
Another common culprit of slow compile times is usage of lazy var.
...That said, we'd be more than happy to take improvement PRs in this area, if you're feeling up for it!
Thanks!
(But at least each expression has a type. While I love Python and have used it for many years, I don't like the uncertainty about types.)
So while type-inference is a neat idea in theory, maybe it's not such a good idea in practice.
>Other similar languages have had pathological cases in type inference, too
These two statements are slightly contradictory. If this is common, then it's not just a bug, but a difficulty in implementing type inference.