https://issues.dlang.org/show_bug.cgi?id=17632
Issue ID: 17632
Summary: 2.075 beta regression: opBinary and delegate code
generation
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
The following code executes successfully with 2.074.1 but segmentation faults
with 2.075.0-b4:
----------------------------------------------------
import std.stdio;
struct Test
{
void delegate() testBody;
Exception unexpected;
void opBinary(string op)(void delegate() fun)
{
testBody = fun;
// Call it
try
testBody();
catch (Exception ex)
unexpected = ex;
}
}
struct URL
{
string fragment;
}
struct JsonCube
{
URL dataURL;
}
struct JsonCubeDef
{
JsonCube _def;
this(string)
{
}
}
immutable TEST_JSON = `{}`;
void main()
{
auto def = cast(immutable) JsonCubeDef(TEST_JSON);
Test() in
{ writeln(def); };
}
--