https://issues.dlang.org/show_bug.cgi?id=17148

          Issue ID: 17148
           Summary: implicit conversion to void[] violates type system
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

void f(int*[] a, const int*[] b)
{
    void[] a1=a;
    const void[] b1=b;
    a1[]=b1[];
    *a[0]=0; //modify const data
}

Probably void[] shouldn't be writable without an explicit cast to, say, byte[].
Pretty similar to issue 2095: cast to void[] here is an upcast and should add
const qualifier. If the data was allocated as void[] from the beginning, then
it may be writable.

--

Reply via email to