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

--- Comment #0 from 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;; // 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:
------- You are receiving this mail because: -------

Reply via email to