digitalmars.D.bugs - [Issue 12744] New: auto ref crashes DMD on ASSERT
- via Digitalmars-d-bugs (28/28) May 13 2014 https://issues.dlang.org/show_bug.cgi?id=12744
https://issues.dlang.org/show_bug.cgi?id=12744 Issue ID: 12744 Summary: auto ref crashes DMD on ASSERT Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: critical Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: tomerfiliba gmail.com This little snippet crashes the compiler (DMD 2.065) on an ASSERT: dmd: mtype.c:9958: void Parameter::toDecoBuffer(OutBuffer*): Assertion `0' failed. ============ void f(int x, out int y) {} void g(alias F)(auto ref ParameterTypeTuple!F args) {} void main() { int y; g!f(1, y); } ============ The issue is that "auto ref" adds 'ref' to y as well, causing a 'ref out' to be inferred, which then fails on an assert in the compiler. Took me half a day to hunt down. --
May 13 2014