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
Comment #1 by k.hara.pg — 2012-01-26T05:49:58Z
https://github.com/D-Programming-Language/dmd/pull/642 This is a shortfall of fixing bug 6902.
Comment #2 by github-bugzilla — 2012-01-28T12:56:51Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/24d920a8d96ccee6394a3b4f987881956c071c54 Merge pull request #642 from 9rnsr/fix7321 Issue 7321 - returning void considered unsafe by safety inference