void main()
{
immutable i = 42;
auto dg = delegate void() immutable { auto inner = i; };
void delegate() shared dg2 = dg; // Fails
}
---
This might be a useful conversion to have for non-templated functions like std.concurrency.Scheduler.spawn (which currently does not enforce shared/immutable context).
Comment #1 by dfj1esp02 — 2015-11-09T13:35:04Z
Delegates don't have context qualifier, see issue 1983.
Comment #2 by robert.schadek — 2024-12-13T18:45:44Z