[UDA] Error: first argument is not a symbol

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 15 05:56:18 PDT 2016


On 9/15/16 4:48 AM, drug wrote:
> https://dpaste.dzfl.pl/9548c481ce46
>
> shouldn't commented line return 'false' as built-in type 'int' has no
> any UDAs instead of cryptic (for me) message about wrong first argument?

This is due to int not being a symbol, which apparently 
__traits(getAttributes, ...) requires.

int is a keyword and not considered a symbol. An annoying distinction 
without a difference in this case. I'd say it's something we should fix, 
but this kind of problem has existed forever. Not sure if it will get 
attention.

-Steve


More information about the Digitalmars-d-learn mailing list