Mercurial > projects > dstress
diff nocompile/invariant_05.d @ 59:96cadd0da1ae
added invariant tests
author | thomask |
---|---|
date | Fri, 22 Oct 2004 20:29:58 +0000 |
parents | |
children | f87ba6507260 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/invariant_05.d Fri Oct 22 20:29:58 2004 +0000 @@ -0,0 +1,17 @@ +// invariant is only allowed in classes (dmd-0.104 documentation) + +module dstress.nocompile.invariant_05; + +invariant{ + assert(0); +} + +int dummy; + +static this(){ + dummy=4; +} + +static ~this(){ + dummy++; +}