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