Is a zero length slice a legitimate structure?
Ie
var s, t: String(10); begin if EQ( s[1..0], t[1..0] ) then begin WriteLn( 'TRUE' ); end; end.
Should that work?
Currently it gives
testpas.pas:6: size of array is too large
however, if the 0 is changed to a runtime variable:
var s, t: String(10); n: Integer; begin n := 0; if EQ( s[1..n], t[1..n] ) then begin WriteLn( 'TRUE' ); end; end.
Then it returns TRUE (as expected, sort of).
Similarly for s := t[1..0]; etc.
So, is it legitimate or not? If it is, the compile error is a bug. If not, then there seems to be a missing runtime range check error (or do I have to enable that)?
Thanks, Peter.