[fpc-devel] Suggestion for change: Overly strict check

Micha Nelissen micha at neli.hopto.org
Thu Sep 28 18:08:56 CEST 2006


Christian Iversen wrote:
> rare, however - and you have to be careful anyway, because this restriction 
> is not consistent: 
> 
> var
>   wait: boolean;
> 
> procedure tfoo.ReadStuff(buffer: tbuffer; wait: boolean);
> begin
>   // In here, wait could refer either to the parameter, or the global var. 
> end;

If the goal is consistency, I'd rather disable this scenario (with an
appropriate error message) as well, rather than enable the other scenario.

> However, it's not confused with the global var, because standard scoping rules 
> apply. Same as with inner functions and such. Also, if you have a unit foo, 

It's not about confusion to the compiler, it's about confusion to the
reader of the code :-).

Micha



More information about the fpc-devel mailing list