comparison 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
comparison
equal deleted inserted replaced
1588:d20691fd37af 1589:c82cb55ee1ea
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 // @author@ Kris <du@bar.com>
6 // @date@ 2005-10-28
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=5233
8
9 // __DSTRESS_ELINE__ 17
10
11 module dstress.nocompile.s.static_34_A;
12
13 int main(){
14 class C{
15 static C create(){
16 // ERROR: needs context for newing nested class
17 return new C;
18 }
19 }
20
21 C c1 = new C;
22 assert(c1);
23
24 C c2 = c1.create();
25 assert(c2);
26
27 C c3 = C.create();
28 assert(c3);
29
30 return 0;
31 }
32