On 2012-39-06 20:11, Jacob Carlborg <d...@me.com> wrote:

On 2012-11-06 19:24, David Nadlinger wrote:

You are right, UDAs must definitely leverage D's module system for
encapsulation/disambiguation. Use of string literals (which are
intrinsically »global«) as annotations needs to be explicitly discouraged.

Then why allow it in the first place?


Because string literals are just a special case of literals?

i.e. if this works:

struct MyString {
    string s;
    alias s this;
}

@MyString("Foo") int n;

then why should this not work:

@"Foo" int n;

I agree it's useless, but it seems a very arbitrary restriction, too.

--
Simen

Reply via email to