www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14040] New: Doesn't use assignment in slice

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

          Issue ID: 14040
           Summary: Doesn't use assignment in slice
           Product: D
           Version: unspecified
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: alphaglosined gmail.com

Example code:
import std.stdio;

void main() {
    uint[] values = [0, 1, 2, 3, 4, 5, 6, 7];
    uint offset = 2;

    writeln(values[offset .. offset += 2]);
    writeln(offset);
}

Outputs:
[]
4

Expected output:
[2, 3]
4

Works correctly in LDC 2.063.2 (thanks DPaste).
Doesn't work in DMD 2.065 or 2.066.1

--
Jan 24 2015