Mercurial > projects > dstress
comparison run/i/inline_10_C.d @ 556:5cfc11e8cfce
-inline calling wrong virtual function
Vathix <vathix@dprogramming.com>
2005-05-22
news:op.sq4gt8ddkcck4r@esi
author | thomask |
---|---|
date | Wed, 01 Jun 2005 11:58:48 +0000 |
parents | |
children | 1e6afb94ce6d |
comparison
equal
deleted
inserted
replaced
555:1300c1aab744 | 556:5cfc11e8cfce |
---|---|
1 // $HeadURL$ | |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Vathix <vathix@dprogramming.com> | |
6 // @date@ 2005-05-22 | |
7 // @uri@ news:op.sq4gt8ddkcck4r@esi | |
8 // @desc@ -inline calling wrong virtual function | |
9 | |
10 // __DSTRESS_DFLAGS__ -inline | |
11 | |
12 module dstress.run.i.inline_10_C; | |
13 | |
14 class Base{ | |
15 int test(){ | |
16 return 1; | |
17 } | |
18 } | |
19 | |
20 class Derived : Base{ | |
21 int test(){ | |
22 return 2; | |
23 } | |
24 | |
25 int baseTest(){ | |
26 return super.test(); | |
27 } | |
28 } | |
29 | |
30 int main(){ | |
31 Base b = new Base(); | |
32 assert(b.test()==1); | |
33 | |
34 Derived f = new Derived(); | |
35 assert(f.test()==2); | |
36 assert(f.baseTest()==1); | |
37 return 0; | |
38 } |