D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7321 - returning void considered unsafe by safety inference
Summary: returning void considered unsafe by safety inference
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
 
Reported: 2012-01-19 09:51 UTC by timon.gehr
Modified: 2012-01-28 14:09 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description timon.gehr 2012-01-19 09:51:50 UTC
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 Kenji Hara 2012-01-26 05:49:58 UTC
https://github.com/D-Programming-Language/dmd/pull/642

This is a shortfall of fixing bug 6902.
Comment 2 github-bugzilla 2012-01-28 12:56:51 UTC
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