www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13084] New: ModuleInfo.opApply delegate expects immutable

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

          Issue ID: 13084
           Summary: ModuleInfo.opApply delegate expects immutable
                    parameter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: doob me.com

The following code works fine in DMD 2.065.0:

void main ()
{
    ModuleInfo* minfo;

    foreach (m ; ModuleInfo)
        minfo = m;
}

But in DMD 2.066.0-b1 the delegate parameter in ModuleInfo.opApply expects an
immutable ModuleInfo*. This is a breaking change and a regression.

Is it possible to fix this by overloading opApply with a mutable parameter?

--
Jul 09 2014