[Issue 19120] New: Cannot slice a struct with a tuple alias this

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 27 09:01:58 UTC 2018


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

          Issue ID: 19120
           Summary: Cannot slice a struct with a tuple alias this
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: yshuiv7 at gmail.com

Right now if a struct has a tuple as its alias this, we could index it at
compile time, but not slicing it.

struct A(T...) {
    alias S = T;
    alias S this;
}

alias X = A!(int, double);
alias Y = X[0]; // Fine
alias Z = X[0..$]; // Not fine?

https://godbolt.org/g/phwQFo

--


More information about the Digitalmars-d-bugs mailing list