Henry Vermaak wrote on Tue, 23 Feb 2016:
On Tue, Feb 23, 2016 at 02:13:52PM +0100, Jonas Maebe wrote:
It would probably be useful if we added support to the compiler to
generate a warning (or even error) in case a with statement hides an
existing symbol in scope though.
Yes, please. Something like -Wshadow would be very useful.
That already exists and is enabled by default for local variables and
parameter names hiding fields. It even gives errors in FPC and ObjFPC
modes, rather than warnings. It's just not (yet) implemented for
with-statements (and local variables or fields hiding global
variables, but that's a different matter).
Jonas
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal