[Issue 19721] Cannot take address of scope local variable even with dip1000 if a member variable is a delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 4 05:14:47 UTC 2020


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

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> ---
It also fails to compile if dg is defined as `int* dg;`:

---------------
void main() @safe {
    scope s = Struct();
    func(&s);
}

private struct Struct { int* dg; }

void func(scope Struct* clientData) @safe nothrow { }
-----------------------

In fact, it has nothing to do with structs, as this fails to compile the same
way:

-----
void main() @safe {
    scope int* s = null;
    func(&s);
}

void func(scope int** clientData) @safe nothrow { }
------

--


More information about the Digitalmars-d-bugs mailing list