On 03/10/2010 09:23 AM, bearophile wrote:
Andrei Alexandrescu:
The idea is sensible and is already in effect for the ".length" property
of arrays.
I didn't know that. So I have tried this code:
void main() {
int[] a;
a.length++;
a.length--;
}
The compiler shows the following errors, is this correct?
test1.d(3): Error: a.length is not an lvalue
test1.d(4): Error: a.length is not an lvalue
So I have tried this, and this compiles:
void main() {
int[] a;
++a.length;
--a.length;
}
Bye,
bearophile
That's a bug worth submitting.
Andrei