[Issue 7511] New: purity inference does not work for methods of templated aggregates
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 15 11:17:35 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7511
Summary: purity inference does not work for methods of
templated aggregates
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: timon.gehr at gmx.ch
--- Comment #0 from timon.gehr at gmx.ch 2012-02-15 11:17:33 PST ---
DMD 2.058:
struct S(T){
T foo(T x){return 2*x;} // this is a pure function for T==int
}
void main()pure{
S!int s;
s.foo(2); // error
}
Error: pure function 'main' cannot call impure function 'foo'
The code should compile. (Turtles all the way down: It should work for methods
of nested aggregates of arbitrary nesting level.)
--
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