@@ -97,7 +97,7 @@ class ArrayIndexError : RangeError
9797 this .length = length;
9898
9999 // Constructing the message is a bit clumsy:
100- // It's essentially `printf("index [%zu] exceeds array of length [%zu]", index, length)`,
100+ // It's essentially `printf("index [%zu] is out of bounds for array of length [%zu]", index, length)`,
101101 // but even `snprintf` isn't `pure`.
102102 // Also string concatenation isn't `@nogc`, and casting to/from immutable isn't `@safe`
103103 import core.internal.string : unsignedToTempString;
@@ -107,7 +107,7 @@ class ArrayIndexError : RangeError
107107 sink.rangeMsgPut(" index [" );
108108 sink.rangeMsgPut(unsignedToTempString! 10 (index, tmpBuf));
109109 sink.rangeMsgPut(" ]" );
110- sink.rangeMsgPut(" exceeds array of length " );
110+ sink.rangeMsgPut(" is out of bounds for array of length " );
111111 sink.rangeMsgPut(unsignedToTempString! 10 (length, tmpBuf));
112112 this .msgBuf = buf;
113113 super (msgBuf[0 .. $- sink.length], file, line, next);
@@ -116,7 +116,7 @@ class ArrayIndexError : RangeError
116116
117117@safe pure unittest
118118{
119- assert (new ArrayIndexError(900 , 700 ).msg == " index [900] exceeds array of length 700" );
119+ assert (new ArrayIndexError(900 , 700 ).msg == " index [900] is out of bounds for array of length 700" );
120120 // Ensure msg buffer doesn't overflow on large numbers
121121 assert (new ArrayIndexError(size_t .max, size_t .max- 1 ).msg);
122122}
0 commit comments