Mercurial > projects > dstress
diff nocompile/s/static_34_A.d @ 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 | run/s/static_34_A.d@b8c0195059d9 |
children |
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; +} +