[Issue 17117] New: auto ref "escaping reference to local variable"
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Mon Jan 23 16:50:36 PST 2017
    
    
  
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 at puremagic.com
          Reporter: rburners at 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"
--
    
    
More information about the Digitalmars-d-bugs
mailing list