[Issue 17632] New: 2.075 beta regression: opBinary and delegate code generation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jul 10 11:38:59 PDT 2017


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: nobody at puremagic.com
          Reporter: briancschott at gmail.com

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); };
}

--


More information about the Digitalmars-d-bugs mailing list