1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
// REQUIRED_ARGS: -o-
// PERMUTE_ARGS:
void main()
{
ubyte[256] data;
foreach (immutable i; 0..256) data[i] = i;
foreach ( const i; 0..256) data[i] = i;
foreach ( i; 0..256) static assert(!__traits(compiles, (data[i] = i)));
foreach (immutable int i; 0..256) data[i] = i;
foreach ( const int i; 0..256) data[i] = i;
foreach ( int i; 0..256) static assert(!__traits(compiles, (data[i] = i)));
foreach (immutable(int) i; 0..256) data[i] = i;
foreach ( const(int) i; 0..256) data[i] = i;
foreach ( int i; 0..256) static assert(!__traits(compiles, (data[i] = i)));
foreach (immutable(ulong) i; 0..256) data[i] = i;
foreach ( const(ulong) i; 0..256) data[i] = i;
foreach ( ulong i; 0..256) static assert(!__traits(compiles, (data[i] = i)));
foreach (immutable i, x; data) data[i] = i;
foreach ( const i, x; data) data[i] = i;
foreach ( i, x; data) static assert(!__traits(compiles, (data[i] = i)));
foreach (immutable int i, x; data) data[i] = i;
foreach ( const int i, x; data) data[i] = i;
foreach ( int i, x; data) static assert(!__traits(compiles, (data[i] = i)));
foreach (immutable(int) i, x; data) data[i] = i;
foreach ( const(int) i, x; data) data[i] = i;
foreach ( int i, x; data) static assert(!__traits(compiles, (data[i] = i)));
foreach (immutable(ulong) i, x; data) data[i] = i;
foreach ( const(ulong) i, x; data) data[i] = i;
foreach ( ulong i, x; data) static assert(!__traits(compiles, (data[i] = i)));
foreach_reverse (immutable i; 0..256) data[i] = i;
foreach_reverse ( const i; 0..256) data[i] = i;
foreach_reverse ( i; 0..256) static assert(!__traits(compiles, (data[i] = i)));
foreach_reverse (immutable int i; 0..256) data[i] = i;
foreach_reverse ( const int i; 0..256) data[i] = i;
foreach_reverse ( int i; 0..256) static assert(!__traits(compiles, (data[i] = i)));
foreach_reverse (immutable(int) i; 0..256) data[i] = i;
foreach_reverse ( const(int) i; 0..256) data[i] = i;
foreach_reverse ( int i; 0..256) static assert(!__traits(compiles, (data[i] = i)));
foreach_reverse (immutable(ulong) i; 0..256) data[i] = i;
foreach_reverse ( const(ulong) i; 0..256) data[i] = i;
foreach_reverse ( ulong i; 0..256) static assert(!__traits(compiles, (data[i] = i)));
foreach_reverse (immutable i, x; data) data[i] = i;
foreach_reverse ( const i, x; data) data[i] = i;
foreach_reverse ( i, x; data) static assert(!__traits(compiles, (data[i] = i)));
//foreach_reverse (immutable int i, x; data) data[i] = i;
//foreach_reverse ( const int i, x; data) data[i] = i;
//foreach_reverse ( int i, x; data) static assert(!__traits(compiles, (data[i] = i)));
//foreach_reverse (immutable(int) i, x; data) data[i] = i;
//foreach_reverse ( const(int) i, x; data) data[i] = i;
//foreach_reverse ( int i, x; data) static assert(!__traits(compiles, (data[i] = i)));
foreach_reverse (immutable(ulong) i, x; data) data[i] = i;
foreach_reverse ( const(ulong) i, x; data) data[i] = i;
foreach_reverse ( ulong i, x; data) static assert(!__traits(compiles, (data[i] = i)));
}
|