Mercurial > projects > dstress
changeset 1589:c82cb55ee1ea
Fix module headers.
Move static_34_A to nocompile: cannot call new for a nested class within a static function.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Mon, 25 Aug 2008 22:05:07 +0200 |
parents | d20691fd37af |
children | 1d1f281a9b11 |
files | nocompile/s/static_34_A.d run/s/static_34_A.d run/t/template_61_C.d |
diffstat | 3 files changed, 33 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/s/static_34_A.d Mon Aug 25 22:05:07 2008 +0200 @@ -0,0 +1,32 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Kris <du@bar.com> +// @date@ 2005-10-28 +// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=5233 + +// __DSTRESS_ELINE__ 17 + +module dstress.nocompile.s.static_34_A; + +int main(){ + class C{ + static C create(){ + // ERROR: needs context for newing nested class + return new C; + } + } + + C c1 = new C; + assert(c1); + + C c2 = c1.create(); + assert(c2); + + C c3 = C.create(); + assert(c3); + + return 0; +} +
--- a/run/s/static_34_A.d Mon Aug 25 21:56:28 2008 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -// $HeadURL$ -// $Date$ -// $Author$ - -// @author@ Kris <du@bar.com> -// @date@ 2005-10-28 -// @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=5233 - -module dstress.run.s.static_34_A; - -int main(){ - class C{ - static C create(){ - return new C; - } - } - - C c1 = new C; - assert(c1); - - C c2 = c1.create(); - assert(c2); - - C c3 = C.create(); - assert(c3); - - return 0; -} -
--- a/run/t/template_61_C.d Mon Aug 25 21:56:28 2008 +0200 +++ b/run/t/template_61_C.d Mon Aug 25 22:05:07 2008 +0200 @@ -7,9 +7,7 @@ // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1143 // @desc@ [Issue 1143] Assertion failure: '0' on line 850 in 'template.c' - On specialization of IFTI template parameters. -// __DSTRESS_ELINE__ 18 - -module dstress.nocompile.t.template_61_C; +module dstress.run.t.template_61_C; void foo(T, U : float = T)(char[] data, T t){ }