local const functions - bug ?

Edwin van Leeuwen via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 7 05:24:08 PDT 2016


On Thursday, 7 July 2016 at 10:33:39 UTC, Basile B. wrote:
> this compiles without error:
>
>
> struct Foo
> {
>     int i;
>     void bar()
>     {
>         void foo() const
>         {
>             i = 1;
>         }
>         foo;
>     }
> }
>
> In this case "const" seems to be a noop. Do you think it's a 
> bug ? Shouldn't "const" be applied, despite of foo() 
> inaccessibility ?

Is this related to:
https://issues.dlang.org/show_bug.cgi?id=1983


More information about the Digitalmars-d-learn mailing list