annotate run/f/foreach_38_C.d @ 1472:22767ec83a24

[Issue 932] static foreach in second template instantiation uses wrong tupleof Frits van Bommel <fvbommel@wxs.nl> 2007-02-06 http://d.puremagic.com/issues/show_bug.cgi?id=932
author thomask
date Thu, 05 Apr 2007 16:36:53 +0000
parents
children a74f0139fc3d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1472
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
1 // $HeadURL$
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
2 // $Date$
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
3 // $Author$
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
4
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
5 // @author@ Frits van Bommel <fvbommel@wxs.nl>
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
6 // @date@ 2007-02-06
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=932
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
8 // @desc@ [Issue 932] static foreach in second template instantiation uses wrong tupleof
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
9
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
10 module dstress.run.f.foreach_38_C;
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
11
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
12 void Fields(C)(){
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
13 foreach(i, a; typeof(C.tupleof)){
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
14 static assert(is(typeof(a) == typeof(C.tupleof)[i]));
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
15 }
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
16 }
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
17
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
18 struct MyStruct1 {
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
19 int afield;
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
20 }
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
21
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
22 struct MyStruct2 {
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
23 real afield;
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
24 }
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
25
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
26 int main(){
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
27 Fields!(MyStruct2);
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
28 return 0;
22767ec83a24 [Issue 932] static foreach in second template instantiation uses wrong tupleof
thomask
parents:
diff changeset
29 }