mixin template withBoilerplate(alias dg)
{
static if (is(typeof(dg()) ReturnType == void))
{
typeof(null) withBoilerplateResult = {
pragma(inline, true);
dg();
return null;
}();
}
else
{
ReturnType withBoilerplateResult = {
pragma(inline, true);
ReturnType value = dg();
return value;
}();
}
}
void main() {
mixin withBoilerplate!({});
}
Compile with -wi, no inlining and no diagnostics.
FuncExp in these initializers do not go in fd.localsymtab. Fixing this also requires relaxing some of the inlining constraints, but that would be mostly trivial.
Compile with
-wi, no inlining and no diagnostics.FuncExpin these initializers do not go infd.localsymtab. Fixing this also requires relaxing some of the inlining constraints, but that would be mostly trivial.