Bug 3635 – Arrays of pointers to forward declared structs fail to compile
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-12-19T19:53:00Z
Last change time
2015-06-09T05:11:52Z
Keywords
rejects-valid
Assigned to
nobody
Creator
siegelords_abode
Comments
Comment #0 by siegelords_abode — 2009-12-19T19:53:40Z
Arrays of pointers to forward declared structs issue compile-time errors in dmd 1.053 (and possibly others). Code to reproduce this bug:
struct Struct;
void main()
{
Struct*[] arr;
arr.length = 1;
}
Workabouts:
Use an associative array.
Declare struct as struct Struct {}; (might not be foolproof, but works for me)
Comment #1 by hsteoh — 2014-11-18T04:46:41Z
Tested on git HEAD, Linux/64. Could not reproduce compile errors. Please reopen if the problem still exists on other platforms / test cases.