annotate tests/mini/arrayinit2.d @ 914:a65a6996922f

Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 01 Feb 2009 23:30:36 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
914
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
1 // bug #191
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
2
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
3 int[3] a = [0: 0, 2: 42, 1: 1];
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
4
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
5 void main()
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
6 {
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
7 assert(a[0] == 0);
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
8 assert(a[1] == 1); // fails!
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
9 assert(a[2] == 42);
a65a6996922f Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
10 }