Summary: implicit conversion to const rules need tightening
           Product: D
           Version: 2.036
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Walter Bright <> 2009-12-16 
13:28:09 PST ---
The following allows a write to an immutable array:

import std.stdio;

void doSomething(const(char)[][] a, const(char)[][] b)

void main()
    string s = "hello";
    char[][1] a;
    string[1] b;
    b[0] = s;
    doSomething(a, b);
    a[0][1] = 'c';   // OOPS!

So, a conversion to const that is not the top ref should be disallowed.

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

Reply via email to