Mercurial > projects > dang
comparison tests/sema/class_1.d @ 168:7982eb63c0eb
Some changes to get function overloading to work. Also class inherit works now - to some extend. needs vtables and all the complex stuff of it.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Thu, 24 Jul 2008 12:06:48 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
166:9cfa33517526 | 168:7982eb63c0eb |
---|---|
1 | |
2 class A | |
3 { | |
4 this() | |
5 { | |
6 } | |
7 | |
8 int foo() | |
9 { | |
10 return 1; | |
11 } | |
12 | |
13 int boo() | |
14 { | |
15 return 0; | |
16 } | |
17 } | |
18 | |
19 class B : A | |
20 { | |
21 this() | |
22 { | |
23 } | |
24 | |
25 int foo() | |
26 { | |
27 return 0; | |
28 } | |
29 } | |
30 | |
31 int main() | |
32 { | |
33 B a = new B(); | |
34 return a.foo() + a.boo(); | |
35 } |