[Issue 19121] New: Indexing a struct with a tuple alias this doesn't give you the thing at given index
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Jul 27 09:53:31 UTC 2018
    
    
  
https://issues.dlang.org/show_bug.cgi?id=19121
          Issue ID: 19121
           Summary: Indexing a struct with a tuple alias this doesn't give
                    you the thing at given index
           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
struct A(T...) {
    alias S = T;
    alias S this;
}
alias X = A!(int, double);
alias Y = X[0]; // Fine
pragma(msg, Y); // Not int ?!?!
// A!(int, double)[0] ???
Y y;
pragma(msg, typeof(y));
pragma(msg, is(typeof(y) == int)); // false ?!
--
    
    
More information about the Digitalmars-d-bugs
mailing list