Mercurial > projects > dstress
annotate nocompile/invariant_16.d @ 374:f87ba6507260
added missing meta-data
author | thomask |
---|---|
date | Thu, 31 Mar 2005 09:01:33 +0000 |
parents | 33346dff2640 |
children | ec5e144583ea |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // invariant is only allowed in class/union/struct (dmd-0.119 documentation) | |
6 | |
7 // __DSTRESS_ELINE__ 13 | |
66 | 8 |
9 module dstress.nocompile.invariant_16; | |
10 | |
11 interface MyInterface{ | |
12 private int check(); | |
13 invariant{ | |
14 assert(check()!=4); | |
15 } | |
16 } | |
17 class MyClass : MyInterface { | |
18 void test(){ | |
19 } | |
20 | |
21 private int check(){ | |
22 return 4; | |
23 } | |
24 } | |
25 | |
26 int main(){ | |
27 Myclass c = new MyClass(); | |
28 c.test(); | |
29 return 0; | |
30 } |