Oxygene does not detect nested for loops using the same loop var

The following code compiles, runs and loops forever.
I’d expect an error at compilation time.

`namespace ForVar;

interface

uses
System.Linq;

type
Program = class
public
class method Main(args: array of String): Int32;
end;

implementation

class method Program.Main(args: array of String): Int32;
var i: Integer;
begin
for i:= 3 downto 1 do begin
for i:= 1 to 3 do begin
writeLn(i);
end;
end;
end;

end.

`

Thanks, logged as bugs://74903

bugs://74903 got closed with status fixed.

With only one variable “i” declared, I’m surprised that that syntax should even be allowed. Seems ambiguous to me. Unless the loop doesn’t really use the variable that is declared.

That’s it, it should not be allowed but the compiler did not detect it.

doh. Yep, I see that now.

bugs://i62938 was closed as fixed.

Logged as bugs://i62938.