Mercurial > projects > dstress
changeset 877:6d54a506f35e
bobef <bobef@lessequal.com>
2006-03-01
news:du4ojh$1b0n$1@digitaldaemon.com
author | thomask |
---|---|
date | Thu, 02 Mar 2006 08:14:59 +0000 |
parents | 549bdf42bf7d |
children | ab1736f2e47e |
files | nocompile/c/class_22_C.d nocompile/c/class_22_E.d run/c/class_22_A.d run/c/class_22_B.d run/c/class_22_D.d |
diffstat | 5 files changed, 198 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/c/class_22_C.d Thu Mar 02 08:14:59 2006 +0000 @@ -0,0 +1,24 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ bobef <bobef@lessequal.com> +// @date@ 2006-03-01 +// @uri@ news:du4ojh$1b0n$1@digitaldaemon.com +// @desc@ dmd: toobj.c:191: virtual void ClassDeclaration::toObjFile(): Assertion `!scope' failed. + +// __DSTRESS_ELINE__ 18 + +module dstress.nocompile.c.class_22_C; + +template T(){ + class A : B{ + } + + class B : A{ + } +} + +void main(){ + mixin T!(); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/c/class_22_E.d Thu Mar 02 08:14:59 2006 +0000 @@ -0,0 +1,24 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ bobef <bobef@lessequal.com> +// @date@ 2006-03-01 +// @uri@ news:du4ojh$1b0n$1@digitaldaemon.com +// @desc@ dmd: toobj.c:191: virtual void ClassDeclaration::toObjFile(): Assertion `!scope' failed. + +// __DSTRESS_ELINE__ 23 + +module dstress.run.c.class_22_E; + +template T(){ + class B : A{ + } + + class A{ + } +} + +void main(){ + mixin T!(); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/class_22_A.d Thu Mar 02 08:14:59 2006 +0000 @@ -0,0 +1,50 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ bobef <bobef@lessequal.com> +// @date@ 2006-03-01 +// @uri@ news:du4ojh$1b0n$1@digitaldaemon.com +// @desc@ dmd: toobj.c:191: virtual void ClassDeclaration::toObjFile(): Assertion `!scope' failed. + +module dstress.run.c.class_22_A; + +template T(){ + class A{ + int x(){ + return 1; + } + } + + class B : A{ + int x(){ + return super.x() + 1; + } + } +} + +mixin T!(); + +int main(){ + A a = new A(); + + if(a.x() != 1){ + assert(0); + } + + + B b = new B(); + + if(b.x() != 2){ + assert(0); + } + + + A c = new B(); + + if(c.x() != 2){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/class_22_B.d Thu Mar 02 08:14:59 2006 +0000 @@ -0,0 +1,50 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ bobef <bobef@lessequal.com> +// @date@ 2006-03-01 +// @uri@ news:du4ojh$1b0n$1@digitaldaemon.com +// @desc@ dmd: toobj.c:191: virtual void ClassDeclaration::toObjFile(): Assertion `!scope' failed. + +module dstress.run.c.class_22_B; + +template T(){ + class B : A{ + int x(){ + return super.x() + 1; + } + } + + class A{ + int x(){ + return 1; + } + } +} + +mixin T!(); + +int main(){ + A a = new A(); + + if(a.x() != 1){ + assert(0); + } + + + B b = new B(); + + if(b.x() != 2){ + assert(0); + } + + + A c = new B(); + + if(c.x() != 2){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/c/class_22_D.d Thu Mar 02 08:14:59 2006 +0000 @@ -0,0 +1,50 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ bobef <bobef@lessequal.com> +// @date@ 2006-03-01 +// @uri@ news:du4ojh$1b0n$1@digitaldaemon.com +// @desc@ dmd: toobj.c:191: virtual void ClassDeclaration::toObjFile(): Assertion `!scope' failed. + +module dstress.run.c.class_22_D; + +template T(){ + class A{ + int x(){ + return 1; + } + } + + class B : A{ + int x(){ + return super.x() + 1; + } + } +} + +int main(){ + mixin T!(); + + A a = new A(); + + if(a.x() != 1){ + assert(0); + } + + + B b = new B(); + + if(b.x() != 2){ + assert(0); + } + + + A c = new B(); + + if(c.x() != 2){ + assert(0); + } + + return 0; +}