https://issues.dlang.org/show_bug.cgi?id=17080
--- Comment #7 from Dicebot <pub...@dicebot.lv> --- (In reply to uplink.coder from comment #6) > I am going to take care of this. > I might take a while though. FYI, this is quick hack I figured out after initial investigation that turns `addrOf` result into delegate: diff --git a/src/expression.d b/src/expression.d index 041ca86ef..0746d51df 100644 --- a/src/expression.d +++ b/src/expression.d @@ -10737,6 +10737,11 @@ extern (C++) final class AddrExp : UnaExp error("'this' reference necessary to take address of member %s in @safe function %s", f.toChars(), sc.func.toChars()); } } + + Expression ethis = new NullExp(loc, f.toAliasFunc().vthis.type); + Expression e = new DelegateExp(loc, ethis, f, ve.hasOverloads); + e = e.semantic(sc); + return e; } } } Haven't checked how it affects other code gen though. --