Quit running foreign unittests >_<

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 10 03:41:56 PDT 2014


On Wednesday, 10 September 2014 at 08:05:28 UTC, ketmar via 
Digitalmars-d wrote:
> yes, templates still sux (considering built-in unittests). this 
> is
> where compiler should be fixed: it should compile unittest 
> invocations
> only for templates that comes from the module it compiles, i 
> think.

That way it will be clear.

By the way, will this link?
---
template A(T)
{
   int a;
   unittest{ f(); }
}

version(unittest) void f(){}
---
If this module is compiled without unittests, `f` function will 
not be compiled, then if another module is compiled with 
unittests and instantiates the template, the template's unittest 
is compiled and it will link with `f` function, which wasn't 
compiled, so linking will fail?


More information about the Digitalmars-d mailing list