From: https://forum.dlang.org/post/syxnzddlnkfwtbvrdfsr@forum.dlang.org ```d import std.stdio; struct Sample{ void function() func1; void function() func2; } void noth(Sample smpl)() { smpl.func1(); // Error: expression __lambda1 is not a valid template value argument smpl.func2(); // Error: expression __lambda2 is not a valid template value argument } void main(){ enum s = Sample( {writeln("Hello world1");}, {writeln("Hello world2");} ); s.func1(); s.func2(); noth!(s)(); } ``` A function literal can be a template value argument and the spec says that "struct literals of template value arguments" are too, so this should be allowed.
@BorisCarvajal created dlang/dmd pull request #12300 "Fix Issue 21753 - Struct literal with function literal member not allowed" fixing this issue: - Fix Issue 21753 - Struct literal with function literal member not allowed as template value argument https://github.com/dlang/dmd/pull/12300
dlang/dmd pull request #12300 "Fix Issue 21753 - Struct literal with function literal member not allowed" was merged into master: - abe4ac1b6a3b89865076cc6f33ff18f29d24bd58 by Boris Carvajal: Fix Issue 21753 - Struct literal with function literal member not allowed as template value argument https://github.com/dlang/dmd/pull/12300
dlang/dlang.org pull request #2989 "abi: add mangling for issue 21753" was merged into master: - e268c4b79dd79aa1198f48372bad86f695c0f40c by Boris Carvajal: abi: add mangling for issue 21753 https://github.com/dlang/dlang.org/pull/2989