[Issue 6265] Pure-inference failed when calling other pure functions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jul 7 13:45:54 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6265
kennytm at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Pure-inference doesn't |Pure-inference failed when
|apply with template alias |calling other pure
|parameter of function |functions
--- Comment #1 from kennytm at gmail.com 2011-07-07 13:40:50 PDT ---
Actually the problem is not due to the template alias parameter, but because
'CallExp::semantic' calls 'Expression::checkPurity' which calls
'FuncDeclaration::isPure' on the outer function, and stops its inference with
'setImpure'.
Two more test cases:
------------------------
pure int h() {
return 1;
}
int f()() {
return h();
}
pure int i() {
return f();
}
-------------------------
-------------------------
pure int h() {
return 1;
}
pure int i() {
return {
return h();
}();
}
-------------------------
--
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