# HG changeset patch # User thomask # Date 1177350723 0 # Node ID c1943ae1abbf010955069961751624f950365bfe # Parent 8732ccec11b25b0cf54fa3a47b4a189795463e96 [Issue 789] const initialization in forwarding constructors doesn't work Vladimir 2007-01-03 http://d.puremagic.com/issues/show_bug.cgi?id=789 diff -r 8732ccec11b2 -r c1943ae1abbf run/c/const_47_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/const_47_A.d Mon Apr 23 17:52:03 2007 +0000 @@ -0,0 +1,30 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Vladimir +// @date@ 2007-01-03 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=789 +// @desc@ [Issue 789] const initialization in forwarding constructors doesn't work + +module dstress.run.c.const_47_A; + +class C{ + const int a; + + this(){ + a = 3; + } + + this(int x){ + this(); + } +} + +int main(){ + C c = new C(2); + if(3 != c.a){ + assert(0); + } + return 0; +} diff -r 8732ccec11b2 -r c1943ae1abbf run/c/const_47_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/const_47_B.d Mon Apr 23 17:52:03 2007 +0000 @@ -0,0 +1,32 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Vladimir +// @date@ 2007-01-03 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=789 +// @desc@ [Issue 789] const initialization in forwarding constructors doesn't work + +module dstress.run.c.const_47_B; + +class C{ + const int a; + + this(){ + a = 3; + } +} + +class D : C { + this(int x){ + super(); + } +} + +int main(){ + D d = new D(2); + if(3 != d.a){ + assert(0); + } + return 0; +}