annotate run/s/struct_initialization_11_B.d @ 1541:fe62f80b7ea1

[Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed? Oskar Linde <oskar.linde@gmail.com> 2007-06-01 http://d.puremagic.com/issues/show_bug.cgi?id=1253
author thomask
date Sun, 01 Jul 2007 13:18:21 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1541
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
1 // $HeadURL$
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
2 // $Date$
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
3 // $Author$
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
4
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
5 // @author@ Oskar Linde <oskar.linde@gmail.com>
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
6 // @date@ 2007-06-01
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1253
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
8 // @desc@ [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
9
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
10 module dstress.run.s.struct_initialization_11_B;
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
11
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
12 struct T {
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
13 int a;
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
14 int b;
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
15 }
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
16
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
17 const T[] arr = [{1, 2}, {3, 4}];
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
18
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
19 int main() {
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
20 T[] arr2 = arr.dup;
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
21
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
22 if(arr2.length != arr.length){
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
23 assert(0);
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
24 }
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
25 if(arr2[0] != arr[0]){
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
26 assert(0);
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
27 }
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
28 if(arr2[1] != arr[1]){
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
29 assert(0);
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
30 }
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
31
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
32 return 0;
fe62f80b7ea1 [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed?
thomask
parents:
diff changeset
33 }