digitalmars.D.bugs - [Issue 15718] New: use ref or out parameters in the anonymous method
- via Digitalmars-d-bugs (45/45) Feb 24 2016 https://issues.dlang.org/show_bug.cgi?id=15718
https://issues.dlang.org/show_bug.cgi?id=15718 Issue ID: 15718 Summary: use ref or out parameters in the anonymous method may cause error Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: mzfhhhh foxmail.com use ref or out parameters in the anonymous method may cause error, for example: void delegate() test1(ref int a,ref int b,ref int c) { return { a=1; b=2; c=3; }; } void delegate() test2() { int i; int a; int b; int c; auto p = test1(a,b,c); return p; } void test3(void delegate() p) { int[3] arr; p(); writeln(arr);//arr output: 1,2,3 } void main(string[] args) { auto p = test2(); test3(p); } --
Feb 24 2016