hasUDA with this
Timoses
timosesu at gmail.com
Thu Jul 26 08:08:17 UTC 2018
On Wednesday, 25 July 2018 at 21:17:38 UTC, jmh530 wrote:
> On Friday, 20 July 2018 at 18:24:11 UTC, Timoses wrote:
>> [snip]
>>
>> It works in module scope
>>
>> https://run.dlang.io/is/OQKYag
>>
>> I don't know why though...
>
> This was reported in 2013. IMO, it should be mentioned in the
> spec if they don't plan on changing it.
>
> https://issues.dlang.org/show_bug.cgi?id=11064
I don't think that bug report relates to the initial question
(UDA not applying to run-time instance).
Regarding this example
void fun() {
/*const*/
{
double bar;
}
static assert(!is (typeof(bar)));
}
it would kind of violate that `bar` is declared within its own
scoped block if the static assert failed just because `const` was
applied to the block.
More information about the Digitalmars-d-learn
mailing list