[Issue 6682] New: Template function that has lazy parameter does not inferred as pure
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Sep 16 14:17:58 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6682
Summary: Template function that has lazy parameter does not
inferred as pure
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-09-16 14:17:37 PDT ---
By fixing bug 5750, the calcLazy should be inferred as pure, but it doesn't.
T calcLazy(T)(lazy T n)
{
return n;
}
int purefunc() pure
{
return calcLazy(1);
// test.d(8): Error: pure function 'purefunc' cannot call impure function
'calcLazy'
}
void main()
{
auto n = purefunc();
}
--
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