Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
July 07, 2011 [Issue 6265] New: Pure-inference doesn't apply with template alias parameter of function | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6265 Summary: Pure-inference doesn't apply with template alias parameter of function Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: kennytm@gmail.com --- Comment #0 from kennytm@gmail.com 2011-07-07 10:24:42 PDT --- Test case: ---------------------- pure int h() { return 1; } int f(alias g)() { return g(); } pure int i() { return f!h(); } ---------------------- x.d(8): Error: pure function 'i' cannot call impure function 'f' ---------------------- The instantiation f!h should be detected as pure, but currently DMD on git master fails to do so. nothrow and @safe are correctly inferred. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 07, 2011 [Issue 6265] Pure-inference failed when calling other pure functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=6265 kennytm@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@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: ------- |
July 09, 2011 [Issue 6265] Pure-inference failed when calling other pure functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=6265 kennytm@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #2 from kennytm@gmail.com 2011-07-09 11:06:14 PDT --- DMD pull #222. https://github.com/D-Programming-Language/dmd/pull/222 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 12, 2011 [Issue 6265] Pure-inference failed when calling other pure functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=6265 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-08-12 00:02:20 PDT --- https://github.com/D-Programming-Language/dmd/commit/b4107b88a3acac76f31bafcad664c48df760ee01 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation