D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7855 - Wrong module dtor order
Summary: Wrong module dtor order
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-08 02:06 UTC by Benjamin Thaut
Modified: 2012-04-09 01:42 UTC (History)
1 user (show)

See Also:


Attachments
repro case (1.10 KB, application/x-zip-compressed)
2012-04-08 02:06 UTC, Benjamin Thaut
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Benjamin Thaut 2012-04-08 02:06:18 UTC
Created attachment 1084 [details]
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 Martin Nowak 2012-04-09 01:42:41 UTC
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()"