Bug 7855 – Wrong module dtor order

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-08T02:06:00Z
Last change time
2012-04-09T01:42:41Z
Assigned to
nobody
Creator
code

Attachments

IDFilenameSummaryContent-TypeSize
1084repro.ziprepro caseapplication/x-zip-compressed1126

Comments

Comment #0 by code — 2012-04-08T02:06:18Z
Created attachment 1084 repro case When using a mixin template, which uses a module thats imported with a public import, the order the module destructors are called is wrong. The destructor of the module that is used by the mixin template gets called before the destructor of the module that uses the mixin template. Therefore the module that uses the mixin template works on a already destructed version of the module. See attached repro case. Tested with dmd 2.058
Comment #1 by code — 2012-04-09T01:42:41Z
You mixed "static shared this()" into a class. As shared and static are not applicable for a constructor they are ignored (see #3118). A module constructor needs to be "shared static this()"