[Issue 12744] New: auto ref crashes DMD on ASSERT
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue May 13 05:36:42 PDT 2014
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 at puremagic.com
Reporter: tomerfiliba at 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.
--
More information about the Digitalmars-d-bugs
mailing list