Thread overview
[Issue 13269] Traits hasMember, getMember and compiles get buggy with opDispatch
Aug 07, 2014
Daniel Čejchan
Feb 12, 2020
FeepingCreature
Feb 12, 2020
FeepingCreature
Feb 12, 2020
FeepingCreature
Dec 17, 2022
Iain Buclaw
August 07, 2014
https://issues.dlang.org/show_bug.cgi?id=13269

--- Comment #1 from Daniel Čejchan <czdanol@gmail.com> ---
Ah, and that Args ... has to be there, too. Just saying.

--
February 12, 2020
https://issues.dlang.org/show_bug.cgi?id=13269

FeepingCreature <default_357-line@yahoo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |default_357-line@yahoo.de

--- Comment #2 from FeepingCreature <default_357-line@yahoo.de> ---
Just ran into this. Seems to only happen if there's arguments, if you take out Args it correctly determines that opDispatch never matches.

--
February 12, 2020
https://issues.dlang.org/show_bug.cgi?id=13269

--- Comment #3 from FeepingCreature <default_357-line@yahoo.de> ---
Workaround: it works if you use Test.init instead of Test

--
February 12, 2020
https://issues.dlang.org/show_bug.cgi?id=13269

--- Comment #4 from FeepingCreature <default_357-line@yahoo.de> ---
Note: it's actually not possible rn with `hasMember` to check if a *type* has a member without also (brokenly) checking if an expression of the type has the member. The only option is `__traits(compiles, Type.member)`.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=13269

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

--