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

          Issue ID: 14911
           Summary: Compiler found indexing in code "new MyStruct[2].ptr"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

The following code does not compile with dmd v2.068.0.

void main()
{
    int* buf1 = new int[2].ptr;             // Ok

    struct MyStruct {}
    MyStruct* buf2 = (new MyStruct[2]).ptr; // Ok

    // Error: expected TypeTuple when indexing ('[2]'), got 'MyStruct'
    MyStruct* buf3 = new MyStruct[2].ptr;   
}

--

Reply via email to