www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Confusing array resize error

reply MicroWizard <MicroWizard_member pathlink.com> writes:
Error message is correct but points to the declaration
and not the place of wrong usage.
Declaration is in the 3rd line, wrong usage is in the 5th.

Tamas Nagy

C:\Work\D\BUG>dmd const_ary.d
const_ary.d(3): constant kuka.length is not an lvalue

#const_ary.d
1 void main(char[][] arg)
2 {
3 	char[2] kuka;
4 
5 	kuka.length=2;
6 }
Apr 11 2005
parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

MicroWizard schrieb am Mon, 11 Apr 2005 20:22:09 +0000 (UTC):
 Error message is correct but points to the declaration
 and not the place of wrong usage.
 Declaration is in the 3rd line, wrong usage is in the 5th.

 Tamas Nagy

 C:\Work\D\BUG>dmd const_ary.d
 const_ary.d(3): constant kuka.length is not an lvalue

 #const_ary.d
 1 void main(char[][] arg)
 2 {
 3 	char[2] kuka;
 4 
 5 	kuka.length=2;
 6 }
Added to DStress as http://dstress.kuehne.cn/nocompile/length_07.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCW9vJ3w+/yD4P9tIRAr8JAJ9eNjfz9pz45gnv6fHEA5SrMidFVACgz+Yw 8Nz/bsNM1vtIwhxFZyvpolc= =U4U7 -----END PGP SIGNATURE-----
Apr 12 2005