Uncallable delegates
Dukc
ajieskola at gmail.com
Sat May 16 14:07:42 UTC 2026
On Saturday, 16 May 2026 at 07:47:36 UTC, Meta wrote:
> Currently immutable(int* delegate()) means that d.funcptr is
> immutable, but d.context is still mutable. So my suggestion is
> that it also make d.context immutable. This would disallow the
> code with UB that you outlined, because:
This was my original intention when I opened the thread in the
ideas forum, and it is mentioned in the alternatives section of
the DIP.
Quirin Schroll and Nick Treleaven found it unworkable though. See
especially [this
post](https://forum.dlang.org/reply/egsorgodxgyswhzrnivf@forum.dlang.org).
More information about the dip.development
mailing list