D - [BUG](low) incorrect initializing of arrays not reported
- Manfred Nowak (7/7) Feb 06 2004 dmd 0.79, WIN98SE
- J Anderson (11/19) Feb 06 2004 This is to do with empty comma operators being ignored. If you did
dmd 0.79, WIN98SE void main(){ static int[] bar=[0,,,3]; printf("%d\n", bar[1]); } this compiles and outputs `3'. So long.
Feb 06 2004
Manfred Nowak wrote:dmd 0.79, WIN98SE void main(){ static int[] bar=[0,,,3]; printf("%d\n", bar[1]); } this compiles and outputs `3'. So long.This is to do with empty comma operators being ignored. If you did void main() { static int[] bar=[0,,,3]; printf("%d\n", bar.length); } you would get 2. The parhaps the code should cause a compilation error (or initialize emptys with the default (ie constructor)). -- -Anderson: http://badmama.com.au/~anderson/
Feb 06 2004