Bug 11469 – Add function attributes wildcards for `@safe`, `pure`, and `nothrow`
Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-07T09:20:00Z
Last change time
2016-06-07T10:12:44Z
Keywords
safe
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2013-11-07T09:20:25Z
Something like this:
---
// a single wildcard for all:
void f(void delegate() @attr_wildcard del) @attr_wildcard;
---
or better:
---
// `f` is `@safe`, `pure`, and `nothrow` if `del` is:
void f(void delegate() @safe? pure? nothrow? del) @safe? pure? nothrow?;
---
Also see Issue 11412.
Comment #1 by bearophile_hugs — 2013-11-07T11:43:42Z
If you want to this then you have to do it in a principled way, using not just "wildcards" but using sets of attributes in a single algebra of effects, as in Koka language:
http://research.microsoft.com/en-us/projects/koka/
Comment #2 by bugzilla — 2016-06-07T10:12:44Z
This sort of proposal needs a lot of work before it can be considered. I recommend doing it as a DIP.