www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17117] New: auto ref "escaping reference to local variable"

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

          Issue ID: 17117
           Summary: auto ref "escaping reference to local variable"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: rburners gmail.com

auto ref f2(T)(auto ref T t, auto ref T s) {
    return t;
}

auto ref f1(T)(auto ref T t, auto ref T s) {
    return f2(t, s);
}

unittest {
    int a = f1(1,2);
}

This used to work with 2.072. I'm not sure why 2.073 is complaining that.
"escaping reference to local variable t"

--
Jan 23 2017