Is it intentional that forward references in unittests aren't
bearophile
bearophileHUGS at lycos.com
Thu Jun 3 17:49:13 PDT 2010
retard:
> What does this mean? Can't you write a wrapper struct/class inside the
> block if you don't want to expose S and S2 outside the unittest block.
Seen from a high level a unittest section != function. But in D they are implemented as a kind-of-function anyway. So unittests in D2 can show some unwanted characteristics that are present in functions. This means that they are an abstraction that "leaks" (a bit):
http://en.wikipedia.org/wiki/Leaky_abstraction
But I have not criticized this design choice because overall the alternatives can be worse.
Bye,
bearophile
More information about the Digitalmars-d
mailing list