In general the value of function local integer variables is not known at compile time. Therefore they must not be allowed in integer range specifications or arrays size specifications. Yes, such mistakes are not detected by the type checker.
Created attachment 87 [details] Test case Test case using a function local integer in array declaration inside a function.
Fixed on the trunk (rev. 1541).