On Monday, 22 May 2017 at 10:13:02 UTC, Sebastiaan Koppe wrote:
I work with Scala professionally. I often feel its type inference for generics/templates is better than D's; as long as it can find a type _anywhere_ it will use that, no matter where it needs to pull it from.

And how long does that code take to compile ?

type inference is not magic, it's a search for a pattern over the syntax (sub)tree.
Hence it can have quadratic time/memory complexity.

Additionally it's harder to prove sound, i.e. there is more potential for undetected bugs,
As well as making it more surprising when the inference fails.


Reply via email to