Mercurial > projects > ldc
diff tangotests/constructors.d @ 160:b77664331d06 trunk
[svn r176] Fixed a bug with class constructors.
author | lindquist |
---|---|
date | Sun, 04 May 2008 04:35:27 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tangotests/constructors.d Sun May 04 04:35:27 2008 +0200 @@ -0,0 +1,29 @@ +import tango.io.Console; + +class C +{ + this() + { + Cout("C()").newline; + } + this(char[] str) + { + Cout("C(")(str)(")").newline; + } +} + +class D : C +{ + this() + { + super("D"); + Cout("D()").newline; + } +} + +void main() +{ + auto c1 = new C(); + auto c2 = new C("C"); + auto d = new D(); +}