Mercurial > projects > dang
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/sema/class_1.d Thu Jul 24 12:06:48 2008 +0200 @@ -0,0 +1,35 @@ + +class A +{ + this() + { + } + + int foo() + { + return 1; + } + + int boo() + { + return 0; + } +} + +class B : A +{ + this() + { + } + + int foo() + { + return 0; + } +} + +int main() +{ + B a = new B(); + return a.foo() + a.boo(); +}