Thread overview
[Issue 7061] delegates sometimes cannot be used in struct initializers
Jul 02, 2017
Vladimir Panteleev
Jul 02, 2017
timon.gehr@gmx.ch
Jul 23, 2019
Basile-z
Mar 21, 2020
Basile-z
July 02, 2017
https://issues.dlang.org/show_bug.cgi?id=7061

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlang-bugzilla@thecybershad
                   |                            |ow.net

--- Comment #1 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Timon, fairly sure that's not the entire program. What's the definition of S?

--
July 02, 2017
https://issues.dlang.org/show_bug.cgi?id=7061

--- Comment #2 from timon.gehr@gmx.ch ---
(In reply to Vladimir Panteleev from comment #1)
> Timon, fairly sure that's not the entire program. What's the definition of S?

Oops. Thanks! The entire program:

struct S{ void delegate() dg; }
struct T{ int delegate() dg; }

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

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

--
July 23, 2019
https://issues.dlang.org/show_bug.cgi?id=7061

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

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

--- Comment #3 from Basile-z <b2.temp@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
}

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=7061

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--