This needs to be fixed

Manu turkeyman at gmail.com
Sun Aug 25 10:17:24 UTC 2024


On Sun, 25 Aug 2024 at 19:11, Dom DiSc via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Sunday, 25 August 2024 at 06:59:11 UTC, Manu wrote:
> > Here's another one just now:
> >
> > return __traits(getMember, instance, funName)(args);   // this
> > works as it
> > should
> >
> >
> > alias fun = __traits(getMember, instance, funName);
> > return fun(args);   // error : calling non-static function
> > `myFun` requires
> > an instance of type `T`
>
> Funny error message. Where does myFun and T come from?
>

struct T
{
  void myFun(int) {}
}
T instance;
enum funName = "myFun";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20240825/1d9d7e65/attachment.htm>


More information about the Digitalmars-d mailing list