digitalmars.D.learn - [UDA] Error: first argument is not a symbol
- drug (3/3) Sep 15 2016 https://dpaste.dzfl.pl/9548c481ce46
- Steven Schveighoffer (8/11) Sep 15 2016 This is due to int not being a symbol, which apparently
- drug (2/9) Sep 15 2016 Thank you for answer
- Jonathan M Davis via Digitalmars-d-learn (13/24) Sep 15 2016 Given the fact that Walter theoretically agreed to fix it so that alias
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?
Sep 15 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
Sep 15 2016
15.09.2016 15:56, Steven Schveighoffer пишет: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. -SteveThank you for answer
Sep 15 2016
On Thursday, September 15, 2016 08:56:18 Steven Schveighoffer via Digitalmars- d-learn wrote:On 9/15/16 4:48 AM, drug wrote:Given the fact that Walter theoretically agreed to fix it so that alias parameters accepted built-in types and not just symbols, that might translate to treating int and friends as symbols in general, which would fix this case. I don't know. There's certainly no need to ever check whether a built-in type has a UDA, because it never will, so in that respect, it doesn't really matter, but it could become annoying in generic code, because you might have to explicitly check for built-in symbols to workaround this. I've opened an enhancement request: https://issues.dlang.org/show_bug.cgi?id=16496 - Jonathan M Davishttps://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.
Sep 15 2016