D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11358 - debug import and getUnittests do not mix
Summary: debug import and getUnittests do not mix
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2013-10-25 15:58 UTC by Daniel Davidson
Modified: 2013-10-26 11:09 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Daniel Davidson 2013-10-25 15:58:41 UTC
The following code will segfault when run with:
dmd -main -unittest c.d
However it runs fine with
dmd -main -unittest -debug c.d

import std.typetuple;
import std.stdio;
debug import std.datetime;
unittest { writeln("In Test!!"); }
mixin("alias mod = " ~ __MODULE__ ~ ";");
alias tests = TypeTuple!(__traits(getUnitTests, mod));
static this() {
  writeln("Done");
}
Comment 1 Kenji Hara 2013-10-26 06:36:48 UTC
Reduced test case:

debug {  }
enum len = __traits(getUnitTests, mixin(__MODULE__)).length;


Compiler fix:
https://github.com/D-Programming-Language/dmd/pull/2695
Comment 2 github-bugzilla 2013-10-26 11:09:31 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3bee007ab0a68fd36d397a004a1a43af9d0b550c
fix Issue 11358 - debug import and getUnittests do not mix

https://github.com/D-Programming-Language/dmd/commit/ece5793e34711f217cac02b19b5f5479a1320c9f
Merge pull request #2695 from 9rnsr/fix11358

Issue 11358 - debug import and getUnittests do not mix