hasUDA with this

jmh530 john.michael.hall at gmail.com
Mon Jul 30 10:56:00 UTC 2018


On Thursday, 26 July 2018 at 16:52:31 UTC, Ali Çehreli wrote:
> [snip]
>
> It doesn't but the scope itself is legal in a nested scope; so, 
> 'const' should not remove the scope either.
>
> > It works at the
> > global level just fine.
>
> It must be because one cannot introduce a nested scope at the 
> global scope:
>
> // illegal
> {
>     double bar;
> }
>
> void main() {
>     // legal
>     {
>         double bar;
>     }
> }
>
> Ali

We seem to be getting caught in scopes, when const: fails just as 
much as const {} does. The spec suggests that both of those work 
for all attributes including UDAs, when it only works on a 
limited subset outside of global scope.


More information about the Digitalmars-d-learn mailing list