| 1 |
module b20890; |
| 2 |
// https://issues.dlang.org/show_bug.cgi?id=20890 |
| 3 |
|
| 4 |
struct S0 { } |
| 5 |
void format0(string spec, S0[1] s) |
| 6 |
{ |
| 7 |
assert (spec == "lengthy"); |
| 8 |
} |
| 9 |
struct S1 { ubyte m = 42; } |
| 10 |
void format1(string spec, S1[1] s) |
| 11 |
{ |
| 12 |
assert (spec == "lengthy"); |
| 13 |
assert (s[0].m == 42); |
| 14 |
} |
| 15 |
struct S2 { ushort m = 42; } |
| 16 |
void format2(string spec, S2[1] s) |
| 17 |
{ |
| 18 |
assert (spec == "lengthy"); |
| 19 |
assert (s[0].m == 42); |
| 20 |
} |
| 21 |
struct S4 { uint m = 42; } |
| 22 |
void format4(string spec, S4[1] s) |
| 23 |
{ |
| 24 |
assert (spec == "lengthy"); |
| 25 |
assert (s[0].m == 42); |
| 26 |
} |
| 27 |
struct S8 { ulong m = 42; } |
| 28 |
void format8(string spec, S8[1] s) |
| 29 |
{ |
| 30 |
assert (spec == "lengthy"); |
| 31 |
assert (s[0].m == 42); |
| 32 |
} |
| 33 |
struct S42 { ubyte[42] m = [42]; } |
| 34 |
void format42(string spec, S42[1] s) |
| 35 |
{ |
| 36 |
assert (spec == "lengthy"); |
| 37 |
assert (s[0].m[0] == 42); |
| 38 |
} |
| 39 |
|
| 40 |
void main() |
| 41 |
{ |
| 42 |
{ S0[1] s; format0("lengthy", s); } |
| 43 |
{ S1[1] s; format1("lengthy", s); } |
| 44 |
{ S2[1] s; format2("lengthy", s); } |
| 45 |
{ S4[1] s; format4("lengthy", s); } |
| 46 |
{ S8[1] s; format8("lengthy", s); } |
| 47 |
{S42[1] s;format42("lengthy", s); } |
| 48 |
} |