On Friday, 7 June 2019 at 16:33:13 UTC, Machine Code wrote: > All this effort is because I do not want unittest code in a > release or even debug. Well, that part is easy: version(unittest) struct Foo {} at any scope is only build when unittests are turned on in this build.