[Issue 21538] Overriding with more attributes on delegate parameter is allowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 10 01:09:13 UTC 2021


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

Bolpat <qs.il.paperinik at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, safe

--- Comment #1 from Bolpat <qs.il.paperinik at gmail.com> ---
DMD rejected the override from version 2.066 to 2.074.1; the regression affects
DMD since 2.075.1.

Just to prove that the cast and the actual delegate isn't the issue,
the following compiles, too:

    auto dg = delegate() @system { int* p; int x; p = &x; }; // unsafe actions
    I i = new C;
    i.f(dg); // okay, unexpeced

It works with function pointers, too:

    auto fp = () @system { int* p; int x; p = &x; };
    i.g(fp);

--


More information about the Digitalmars-d-bugs mailing list