www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16248] New: nested const functions can mutate the aggregate

https://issues.dlang.org/show_bug.cgi?id=16248

          Issue ID: 16248
           Summary: nested const functions can mutate the aggregate
                    members
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

This compiles without error

struct Foo
{
    int i;
    void bar()
    {
        void foo() const /*immutable as well*/
        {
            i = 1;
        }
        foo;
    }
}

--
Jul 07 2016