[Issue 6356] Pure/nothrow/@safe-inference failed for a template function if it is instantiated without evaluating at the global scope

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 20 11:09:15 PDT 2011


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


kennytm at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|Other                       |All
         OS/Version|Mac OS X                    |All
           Severity|normal                      |major


--- Comment #1 from kennytm at gmail.com 2011-07-20 11:09:12 PDT ---
Raising severity because unaryFun and binaryFun are used in template
constraints or return types. This bug makes std.algorithm.equal not able to be
pure/nothrow/@safe, for example.

2nd test case:
-----------------------------
bool f6356b()() {
    return true;
}
void g6356b()() if (is(typeof(f6356b()))) {
    f6356b();
}
void h6356b() pure nothrow @safe {
    //f6356b();    // <-- uncomment to make it compile.
    g6356b();
}
-----------------------------
x.d(9): Error: pure function 'h6356b' cannot call impure function 'g6356b'
x.d(9): Error: safe function 'h6356b' cannot call system function 'g6356b'
x.d(9): Error: g6356b is not nothrow
x.d(7): Error: function x.h6356b 'h6356b' is nothrow yet may throw
-----------------------------

-- 
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