Get the return type of the function

Ivan Kazmenko via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 3 15:57:12 PST 2016


On Wednesday, 3 February 2016 at 22:09:37 UTC, sigod wrote:
> On Wednesday, 3 February 2016 at 19:21:06 UTC, Meta wrote:
>> Ah, I see. I'd like to test something; can you please change 
>> `(a) => a * a` to
>> `(int a) => a * a` and post the results?
>
> This works.
>
> http://dpaste.dzfl.pl/92c254ef6cf6

Seems reasonable: `(int a) => a * a` has return type `int` but 
just `(a) => a * a` does not yet know the type of `a`, and so can 
not tell the return type.


More information about the Digitalmars-d-learn mailing list