Mercurial > projects > dstress
comparison 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 |
comparison
equal
deleted
inserted
replaced
1540:94c9f2f9af4b | 1541:fe62f80b7ea1 |
---|---|
1 // $HeadURL$ | |
2 // $Date$ | |
3 // $Author$ | |
4 | |
5 // @author@ Oskar Linde <oskar.linde@gmail.com> | |
6 // @date@ 2007-06-01 | |
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1253 | |
8 // @desc@ [Issue 1253] DMD 0.175 introduced bug: array initializers as expressions are not allowed? | |
9 | |
10 module dstress.run.s.struct_initialization_11_B; | |
11 | |
12 struct T { | |
13 int a; | |
14 int b; | |
15 } | |
16 | |
17 const T[] arr = [{1, 2}, {3, 4}]; | |
18 | |
19 int main() { | |
20 T[] arr2 = arr.dup; | |
21 | |
22 if(arr2.length != arr.length){ | |
23 assert(0); | |
24 } | |
25 if(arr2[0] != arr[0]){ | |
26 assert(0); | |
27 } | |
28 if(arr2[1] != arr[1]){ | |
29 assert(0); | |
30 } | |
31 | |
32 return 0; | |
33 } |