Bug 7202 – Hole in type system still present for delegates
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2012-01-02T11:33:00Z
Last change time
2013-08-05T13:26:44Z
Keywords
accepts-invalid, patch
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2012-01-02T11:33:08Z
For example:
void main() {
void delegate()@system x = {writeln("I am @system");};
void delegate()@safe y = {};
auto px = &x;
auto py = &y;
px = py; // accepts-invalid
*px = x;
y(); // "I am @system"
}
The equivalent example with function pointers already results in a compile error.