Mercurial > projects > dstress
annotate nocompile/invariant_16.d @ 66:33346dff2640
extended invariant tests
author | thomask |
---|---|
date | Sat, 23 Oct 2004 10:09:46 +0000 |
parents | |
children | f87ba6507260 |
rev | line source |
---|---|
66 | 1 // invariant is only allowed in classes (dmd-0.104 documentation) |
2 | |
3 module dstress.nocompile.invariant_16; | |
4 | |
5 interface MyInterface{ | |
6 private int check(); | |
7 invariant{ | |
8 assert(check()!=4); | |
9 } | |
10 } | |
11 class MyClass : MyInterface { | |
12 void test(){ | |
13 } | |
14 | |
15 private int check(){ | |
16 return 4; | |
17 } | |
18 } | |
19 | |
20 int main(){ | |
21 Myclass c = new MyClass(); | |
22 c.test(); | |
23 return 0; | |
24 } |