www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14302] New: New style opSlice doesn't compile

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

          Issue ID: 14302
           Summary: New style opSlice doesn't compile
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: dieselmachine mail.ru

Created attachment 1493
  --> https://issues.dlang.org/attachment.cgi?id=1493&action=edit
Test case

According to the documentation at http://dlang.org/operatoroverloading.html
slice operators should be rewritten like
a.opIndexUnary!("$(METACODE op)")(a.opSlice(i, j))
a.opIndexAssign(c, a.opSlice(i, j))
a.opIndexOpAssign!("$(METACODE op)")(c, a.opSlice(i, j))
but currently this code is not compiled. The test case is in the attachment.

--
Mar 17 2015