[Issue 7061] delegates sometimes cannot be used in struct initializers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 23 01:25:00 UTC 2019


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

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |b2.temp at gmx.com
         Resolution|---                         |WORKSFORME

--- Comment #3 from Basile-z <b2.temp at gmx.com> ---
struct S{ void delegate() dg; }
struct T{ int delegate() dg; }

int x;
S a = {{}};              // ok
S b = {{;}};             // ok
S c = {{x=0;}};          // ok
T d = {{return 0;}};     // ok

void main(){
    int g;
    S x1 = {{}};            // ok
    S y = {{;}};            // ok
    S z = {{x=0;}};         // ok
    T w = {{return 0;}};    // ok
}

--


More information about the Digitalmars-d-bugs mailing list