www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21445] New: Indexing a tuple in a static array type suffix

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

          Issue ID: 21445
           Summary: Indexing a tuple in a static array type suffix fails
                    to compile
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: CTFE, rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: maxsamukha gmail.com

import std.typecons;

enum s = tuple(new int[1]);
int[s[0].length] a;

void main() {
}

onlineapp.d(4): Error: Tuple([0]) must be an array or pointer type, not
Tuple!(int[])

Workaround:

enum t = s[0];
int[t.length] a;

--
Dec 02 2020