Bug 7321 – returning void considered unsafe by safety inference
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-19T09:51:00Z
Last change time
2012-01-28T14:09:02Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2012-01-19T09:51:50Z
In the following code, the second delegate literal is incorrectly inferred as unsafe:
static assert(is(typeof((){})==void function()pure nothrow @safe)); // ok
static assert(is(typeof((){return;})==void function()pure nothrow @safe));// fail
Error: static assert (is(void function() pure nothrow == void function() pure nothrow @safe)) is false