[Issue 21445] New: Indexing a tuple in a static array type suffix fails to compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 2 13:21:05 UTC 2020


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 at puremagic.com
          Reporter: maxsamukha at 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;

--


More information about the Digitalmars-d-bugs mailing list