Bug 18872 – -dip1000 does not allow static arrays for types with destructors
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2018-05-18T19:27:00Z
Last change time
2020-04-14T15:25:13Z
Assigned to
No Owner
Creator
Ate Eskola
Comments
Comment #0 by Ajieskola — 2018-05-18T19:27:00Z
@safe:
static struct AType
{ ~this(){}
}
void main()
{ AType[5] array;
}
complains:
reference to local variable 'array' assigned to non-scope parameter 'a' calling object._ArrayDtor!(CopyPreventer)._ArrayDtor
As I understand it, running a destroyer when finalizing a static array should work just as well as finalizing a single local with an elaborate destructor.
Comment #1 by pro.mathias.lang — 2020-04-14T15:25:13Z