www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16418] New: dip25 wrong escaping reference to this


          Issue ID: 16418
           Summary: dip25 wrong escaping reference to this
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

when compiling with -dip25

struct S(things...)
    ref foo(newThings...)()
        alias NewT = S!(things, newThings);
        return *(() => cast(NewT*)&this)();

void main()
    S!float s;
    auto s1 = s.foo!(int); //OK
    auto s2 = s.foo!(); //Error escaping reference to this

worked fine in 2.071.2-b1, fails with current git HEAD

Aug 23 2016