[Issue 7452] Function using enforce() cannot be inferred as @safe because of anonymous function due to lazy argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 7 12:10:41 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7452


kennytm at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Function using enforce()    |Function using enforce()
                   |cannot be inferred as @safe |cannot be inferred as @safe
                   |because of the lazy         |because of anonymous
                   |argument                    |function due to lazy
                   |                            |argument


--- Comment #1 from kennytm at gmail.com 2012-02-07 12:10:39 PST ---
Further reduced test case, showing the cause is the function/delegate type, not
'lazy'.

-----------------
int f7452c()(int x)
{
   auto y = function int() { return 0; };
   return x;
}
void g7452c() pure nothrow @safe
{
   assert(4 == f7452c(4));
}
-----------------

Note that 'pure' and 'nothrow' are correctly inferred.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list