140
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
111
|
5 // @author@ tetsuya <tetsuya_member@pathlink.com>
|
|
6 // @date@ 2004-10-29
|
140
|
7 // @uri@ news:cltnob$2qnk$1@digitaldaemon.com
|
1487
|
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2162
|
111
|
9
|
|
10 module dstress.run.array_initialization_03;
|
|
11
|
|
12 template Foo(T, int L){
|
|
13 T[L] arr;
|
|
14 class Bar {
|
|
15 T[L] arr;
|
|
16 }
|
|
17 }
|
|
18
|
|
19 void test(){
|
|
20 alias Foo!(int, 100) foo;
|
|
21 foreach (int x; foo.arr)
|
|
22 assert(x == int.init); // initialized, no problem
|
|
23
|
|
24 foo.Bar bar = new foo.Bar();
|
|
25 foreach (int x; bar.arr)
|
|
26 assert(x == int.init); // not initialized, fails
|
|
27 }
|
|
28
|
|
29 int main(){
|
|
30 test();
|
|
31 return 0;
|
|
32 }
|