Mercurial > projects > dstress
annotate run/alias_04.d @ 1576:b3e16c86558e
[Issue 1398] New: GDC doesn't generate correct code
<mariusmuja@gmail.com>
2007-08-04
http://d.puremagic.com/issues/show_bug.cgi?id=1398
author | thomask |
---|---|
date | Thu, 21 Feb 2008 15:20:08 +0000 |
parents | ec5e144583ea |
children |
rev | line source |
---|---|
374 | 1 // $HeadURL$ |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 module dstress.run.alias_04; | |
0 | 6 |
7 class A { | |
8 int foo(int a) { return 1; } | |
9 } | |
10 | |
11 class B : A { | |
12 int foo( int a, uint b ) { return 2; } | |
13 } | |
14 | |
15 class C : B { | |
16 int foo( int a ) { return 3; } | |
17 alias B.foo foo; | |
18 } | |
19 | |
20 class D : C { | |
21 } | |
22 | |
23 | |
24 int main(){ | |
25 D d = new D(); | |
26 | |
1559 | 27 if(d.foo(1, 2u) != 2){ |
28 assert(0); | |
29 } | |
30 if(d.foo(1) != 3){ | |
31 assert(0); | |
32 } | |
0 | 33 return 0; |
1 | 34 } |