[Issue 19272] New: scope class and const/immutable doesn't work together

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 28 08:24:29 UTC 2018


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

          Issue ID: 19272
           Summary: scope class and const/immutable doesn't work together
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: doob at me.com

The following code fails to compile with DMD 2.082.0:

void main()
{
    scope a = new const Object; //  Error: cannot modify `const` expression `a`
    scope b = new immutable Object; // Error: cannot modify `immutable`
expression `b`
}

--


More information about the Digitalmars-d-bugs mailing list