www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19152] New: 2.081.1 Regression compiler bug

https://issues.dlang.org/show_bug.cgi?id=19152

          Issue ID: 19152
           Summary: 2.081.1 Regression compiler bug
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andre s-e-a-p.de

Executing dub build for https://github.com/andre2007/delta-core-10-2-1.git
fails with compiler bug for 2.081.1. It works fine with 2.080.0

I used dustmite to reduce it to:

--- app.d

template GenEvent(string eventName, T)
{
        const char[] GenEvent =
    `private `~T.stringof~` _`~eventName~`;`~
T.stringof~eventName~`(`~T.stringof~` value) {
                import std.utf: toUTFz;
                import core.sys.windows.windows;

                _`~eventName~`= value;

                auto dlg = __traits(getOverloads, this, "`~eventName~`");
                FARPROC fp = GetProcAddress(deltaLibrary.handle,
"registerNotifyEvent");
                Fn fn = cast(Fn) fp;
                fn(this.reference, pChar, cast(int) dlg.ptr, cast(int)
dlg.funcptr, bindDelegate(dg));  
        }

         property `~eventName~`() {
                return _`~`;
        }`;     
}

auto bindDelegate() {
}

alias TNotifyEvent = void delegate();

class TBasicAction{
        mixin(GenEvent!("OnExecute", TNotifyEvent));
}


void main()
{

}

---

Executing dmd app.d with 2.081.1 returns compiler bug.

Executing it with 2.080.0 returns syntax errors which is expected
as dustmite changed too much. But for analyzing the compiler bug, 
this should be fine.

--
Aug 09 2018