hasUDA with this
Timoses
timosesu at gmail.com
Fri Jul 20 18:24:11 UTC 2018
On Friday, 20 July 2018 at 16:53:12 UTC, jmh530 wrote:
> Hmm, on that part about the attributes copying their values, I
> suppose it would be sufficient if I could apply the attributes
> to a group of declarations. However, it didn't seem to work
> properly for me with UDAs, and I noticed that even some of the
> examples in the spec don't compile. Below is taken from section
> 8.5 and doesn't compile with DMD 2.081.1. (here's a version on
> run.dlang.org: https://run.dlang.io/is/pKHoBA)
>
> void main()
> {
> const int foo = 7;
> static assert(is(typeof(foo) == const(int)));
>
> const
> {
> double bar = foo + 6;
> }
> static assert(is(typeof(bar) == const(double)));
> }
It works in module scope
https://run.dlang.io/is/OQKYag
I don't know why though...
More information about the Digitalmars-d-learn
mailing list