Conflicting UDA

Marc Schütz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 6 07:01:44 PST 2016


On Saturday, 6 February 2016 at 13:36:32 UTC, Márcio Martins 
wrote:
> I came across an issue with UDAs and was wondering if there 
> really is no way or if I just missed something...
>
> Basically, my library has an @ignore UDA, which conflicts with 
> vibe.d's vibe.data.serialization.
>
> If both mine and vibe's module are imported, DMD will fail with 
> a very non-descriptive error message, seen below... The obvious 
> solution would be to prefix my UDAs, but then I suppose every 
> library writer would have to abide by this convention, which in 
> practice won't happen, and would bring us back to the C-style 
> redundant symbol names all over. It's unpleasant to have to 
> disambiguate even when not necessary... I suppose I could also 
> do @mylibattr("ignore") instead, but this is also hideous and 
> overly verbose...
>
> I tried @mylib.ignore, which would not be too bad, if necessary 
> only to disambiguate, but it seems like the parser doesn't 
> understand it.

`@(mylib.ignore)` should work. You could open an enhancement 
request to enable the paren-less syntax.


More information about the Digitalmars-d-learn mailing list