www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14467] New: arr.capacity sometimes erroneously returns 0

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

          Issue ID: 14467
           Summary: arr.capacity sometimes erroneously returns 0
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: schveiguy yahoo.com

Works in 2.066.1, fails in 2.067:

void main()
{
    auto arr = new int[10];
    assert(arr.capacity == 15);
    arr = arr[5..$];
    assert(arr.capacity == 10);
}

I'll take a look at the code, see if I can figure out the fix.

--
Apr 19 2015