www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10829] New: -inline produces wrong code

http://d.puremagic.com/issues/show_bug.cgi?id=10829

           Summary: -inline produces wrong code
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: temtaime gmail.com



I have a big project, so i cannot figure test-case now. I'll investigate in it
a little later. Minimized piece of code that demonstrates the problem.


    static void bringToTop(GUIElement[] arr) {
        if(arr.length < 2)
            return;

        auto p = arr[0];
        auto c = arr[1];

        writefln(`c == %s`, cast(int)cast(void *)c);

        p._childs = c ~ p._childs.filter!(a => (writefln(`in lambda c == %s`,
cast(int)cast(void *)c), a != c)).array;
    }

GUIElement is a class. GUIElement._childs is an array of GUIElement.

Output with -inline:
c == 7982336
in lambda c == 0

Optput without -inline:
c == 3751104
in lambda c == 3751104

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 15 2013