On Friday, 30 January 2015 at 08:52:41 UTC, bearophile wrote:
Jeremy DeHaan:

I figured that it would be smart enough to
deduce the parameter type based on the type that it was trying to be assigned to.

For that you need languages like Haskell/Rust. D type inference doesn't work from the type something is assigned to.

But it could, right (for arguments and return expressions, too)? At least I don't see any real obstacles. Just file an enhancement request if you think it's worthwhile, or start a discussion on digitalmars.D.

Of course, it cannot work for `auto x = getString();` or `foo(getString())` where there are several overloads of `foo()`. The next step would then be overloading on the return type, which is related.

Reply via email to