Is it intentional that forward references in unittests aren't

bearophile bearophileHUGS at lycos.com
Thu Jun 3 15:30:04 PDT 2010


Trass3r:

> void main()
> {
> }
> 
> unittest
> {
> 	struct S
> 	{
> 		S2 s;
> 	}

Being unittests functions, it can be better to use "static struct" there instead of "struct".

-------------------------

Ellery Newcomer:
> It's intentional. Forward references generally aren't allowed inside 
> function bodies.

Unittests being normal functions is an abstraction that leaks a bit, but I presume it's OK.

Bye,
bearophile


More information about the Digitalmars-d mailing list