mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
25 lines
584 B
D
25 lines
584 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/test6883.d(15): Error: array index 5 is out of bounds `x[0 .. 5]`
|
|
fail_compilation/test6883.d(17): Error: array index 7 is out of bounds `x[0 .. 5]`
|
|
fail_compilation/test6883.d(21): Error: array index 5 is out of bounds `x[0 .. 5]`
|
|
fail_compilation/test6883.d(23): Error: array index 7 is out of bounds `x[0 .. 5]`
|
|
---
|
|
*/
|
|
|
|
void main()
|
|
{
|
|
{
|
|
int[5] x;
|
|
x[x.length] = 1;
|
|
enum size_t n = 2;
|
|
x[x.length + n] = 2;
|
|
}
|
|
{
|
|
int[5] x;
|
|
x[$] = 1;
|
|
enum size_t n = 2;
|
|
x[$ + n] = 2;
|
|
}
|
|
}
|