[Issue 2311] New: Static destructors in templates are never run
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Aug 24 05:00:12 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2311
Summary: Static destructors in templates are never run
Product: D
Version: 1.034
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: matti.niemenmaa+dbugzilla at iki.fi
The assertion in the following code never fires:
template X() { static ~this() { assert (false); } }
void main() { alias X!() x; }
Changing the destructor to a constructor makes it work.
--
More information about the Digitalmars-d-bugs
mailing list