https://issues.dlang.org/show_bug.cgi?id=22487
Issue ID: 22487
Summary: Array!T.init.data crashes
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
The fix for issue 21100 is buggy, the following code crashes:
---
void main(){
import std.container;
Array!int a;
foreach(i;a.data){}
}
---
core.exception.AssertError@std/typecons.d(6644): Attempted to access an
uninitialized payload.
---
It should check whether the data is initialized, like most other members of
Array!T do. If the data is not initialized, it should return an empty dynamic
array.
--