As per http://forum.dlang.org/post/kibnaskimiqnmzziegjo@forum.dlang.org, the following snippet should not compile: --- void* delegateToPtr(void delegate() dg) { return cast(void*)dg; } --- DMD currently returns the delegate context pointer. As I couldn't find any justification for this in the spec, I marked the issue as an »accepts-invalid« bug, but feel free to downgrade it to an enhancement request.
Raised pull: https://github.com/D-Programming-Language/dmd/pull/1754
https://github.com/D-Programming-Language/dmd/commit/0b144954006425587a237be5d3184d50187bedee