https://issues.dlang.org/show_bug.cgi?id=16265

Martin Nowak <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
            Summary|unittest imports should not |batter detection of real
                   |be counted as dependencies  |module cycles
                   |for static ctors            |

--- Comment #2 from Martin Nowak <[email protected]> ---
> unittest {
>    import other; // other imports this module, and contains static ctors
>    other.foo();
> }
> 
> Should not be considered a cycle. The shared ctor cannot possibly call the
> unit test code, so there is no leaking of the import.

Well, unfortunately it's technically possible using `__traits(getUnitTests,
__MODULE__)`, 
and it wouldn't be too far-fetched to call the tests from a static ctor.
The example is pretty close to do that
http://dlang.org/spec/traits.html#getUnitTests.

--

Reply via email to