D-Programming-Language/dmd — comment on commit 675898721c04d0bf155a85abf986eae99c37c0dc
File:  line 0
By JarrettBillingsley:

=> isn't a comparison operator, so your first example is unambiguous.

As for how it works: the types are inferred, of course, but that would be too useful for general use to make it general. Much like how the 'auto' return type mysteriously only works on templated functions.