www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22723] New: Cannot allocate a slice

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

          Issue ID: 22723
           Summary: Cannot allocate a slice
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: temtaime gmail.com

This code should be allowed, but it results in error:
ubyte[]* a = new ubyte[];
Error: missing length argument for array

The only way to create it i found so far is:
ubyte[]* a = &(new ubyte[][1])[0];

--
Feb 01 2022