ReturnType and overloaded functions

Kenji Hara via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 12 22:13:39 PDT 2015


2015-06-13 9:29 GMT+09:00 Idan Arye via Digitalmars-d <
digitalmars-d at puremagic.com>:

> On Friday, 12 June 2015 at 23:26:00 UTC, Yuxuan Shui wrote:
>
>> When there are multiple overloaded functions, whose return type will I
>> get when I use ReturnType? Is there a way I could choose a specific
>> function by its parameter types?
>>
>
> The return type of the first declared one:
> http://dpaste.dzfl.pl/f448ec624592
>

That's definitely a bug in current dmd. ReturnType should make error when
overloaded function symbol is given.

To pick up one of the overloaded functions, you can use
__traits(getOverloads).

Kenji Hara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150613/fd44ce29/attachment.html>


More information about the Digitalmars-d mailing list