function overload on full signature?

Jonathan M Davis jmdavisProg at gmx.com
Wed Nov 14 01:09:40 PST 2012


On Wednesday, November 14, 2012 13:05:41 Gor Gyolchanyan wrote:
> Actually the (x) => y style delegates compute their return type exactly by
> looking at the left-hand side. This exact thing is already being done. If
> the ambiguity cannot be resolved, the return type is explicitly set OR the
> result is casted to a type.
> Having normal functions behave this way doesn't add anything new. This
> already exists.

I think that you're wrong about that. (x) => y lambdas are no different from 
any other delegate literals save for  their syntax. The type of x is dependent 
on what's being passed to it, and the type of y depends on x and what the 
function does. It shouldn't have any need whatsoever to look at the expression 
that the lambda is being used in, just what's passed to it.

- Jonathan M Davis


More information about the Digitalmars-d mailing list