| 1 |
// https://issues.dlang.org/show_bug.cgi?id=3703 |
| 2 |
// static array assignment |
| 3 |
/* |
| 4 |
TEST_OUTPUT: |
| 5 |
--- |
| 6 |
fail_compilation/fail3703.d(18): Error: mismatched array lengths 2 and 1 for assignment `b[] = a` |
| 7 |
fail_compilation/fail3703.d(20): Error: mismatched array lengths 2 and 1 for assignment `b[] = a` |
| 8 |
fail_compilation/fail3703.d(22): Error: mismatched array lengths, 3 and 2 |
| 9 |
fail_compilation/fail3703.d(23): Error: mismatched array lengths, 2 and 3 |
| 10 |
fail_compilation/fail3703.d(25): Error: mismatched array lengths, 3 and 2 |
| 11 |
fail_compilation/fail3703.d(26): Error: mismatched array lengths, 2 and 3 |
| 12 |
--- |
| 13 |
*/ |
| 14 |
|
| 15 |
void main() |
| 16 |
{ |
| 17 |
int[1] a = [1]; |
| 18 |
int[2] b = a; // should make compile error |
| 19 |
|
| 20 |
b = a; // should make compile error |
| 21 |
|
| 22 |
int[3] sa3 = [1,2][]; |
| 23 |
int[2] sa2 = sa3[][]; |
| 24 |
|
| 25 |
sa3 = [1,2][]; |
| 26 |
sa2 = sa3[][]; |
| 27 |
} |