Re: Empty UDA for classes not allowed?

2017-10-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 26 October 2017 at 15:09:48 UTC, bauss wrote: Why is it not allowed to have empty UDAs for classes? Let's say we have an UDA like this: struct Exclude { } Then we want to put it on a class like: @Exclude class Foo { ... } This will fail with the following error: Error: type

Re: Empty UDA for classes not allowed?

2017-10-26 Thread bauss via Digitalmars-d-learn
On Thursday, 26 October 2017 at 21:24:43 UTC, Jonathan M Davis wrote: On Thursday, October 26, 2017 15:09:48 bauss via Digitalmars-d-learn wrote: [...] It worked just fine when I just tried it on my machine - both with dmd master and with 2.076.1. Are you using an older version of the

Re: Empty UDA for classes not allowed?

2017-10-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, October 26, 2017 15:09:48 bauss via Digitalmars-d-learn wrote: > Why is it not allowed to have empty UDAs for classes? > > Let's say we have an UDA like this: > struct Exclude { } > > Then we want to put it on a class like: > > @Exclude class Foo > { > ... > } > > This will fail

Empty UDA for classes not allowed?

2017-10-26 Thread bauss via Digitalmars-d-learn
Why is it not allowed to have empty UDAs for classes? Let's say we have an UDA like this: struct Exclude { } Then we want to put it on a class like: @Exclude class Foo { ... } This will fail with the following error: Error: type Exclude has no value But on everything else we can place an