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: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@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: -------

Reply via email to