Summary: Functions with Parameters Implicitly Convertible to
                    Immutable Are Not Pure
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from David Simcha <> 2011-09-08 07:00:45 PDT ---
Using 2.055, where you're allowed to implicitly convert return values of
strongly pure functions to immutable.  

char[] foo(string s) pure {
    return s.dup;

void main() {
    string dummy;
    string s = foo(dummy);

D:\home\dsimcha\bin\test.d(7): Error: cannot implicitly convert expression
(foo(dummy)) of type char[] to string

If I change the signature to:

char[] foo(immutable string s) pure 

then it works.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to