[Issue 6356] New: 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 09:03:14 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6356
Summary: Pure/nothrow/@safe-inference failed for a template
function if it is instantiated without evaluating at
the global scope
Product: D
Version: D2
Platform: Other
OS/Version: Mac OS X
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: kennytm at gmail.com
--- Comment #0 from kennytm at gmail.com 2011-07-20 09:03:11 PDT ---
Test case:
------------------------------
int f6356()(int a) {
return a*a;
}
alias f6356!() g6356; // comment this out to eliminate the errors
pure nothrow @safe int i6356() {
return f6356(1);
}
------------------------------
x.d(6): Error: pure function 'i6356' cannot call impure function 'f6356'
x.d(6): Error: safe function 'i6356' cannot call system function 'f6356'
x.d(6): Error: f6356 is not nothrow
x.d(5): Error: function x.i6356 'i6356' 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