www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16094] New: error: overlapping slice assignment (CTFE)

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

          Issue ID: 16094
           Summary: error: overlapping slice assignment (CTFE)
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: rtcvb32 yahoo.com

The following function f works properly when compiled, but during CTFE breaks
and errors out with: Error: overlapping slice assignment [3..6] = [0..3]

char[] f() {
  char[] x = new char[6];
  x[3..6] = x[0..3];
  return x;
}

enum cpy = f();

version: dmd 2.071.0 32bit
OS: Windows 7 x64

--
May 29 2016