I think fpc should be more strict to prevent reusing things that should be reserved words.
This is not about reserved words or keywords. For those one needs to prefix them with
& to be able to use them (e.g.
&type or
&while). Anything contained in the
System unit however is
not a keyword. They are just symbols and for these the normal visibility rules apply. Not to mention that FPC itself
uses this functionality:
Integer is declared as 16-bit signed type in the
System unit, but as a 32-bit signed type in the
ObjPas unit which is automatically used if mode
ObjFPC or
Delphi is used, thus using
Integer will in fact access
ObjPas.Integer unless you manually specify
System.Integer. This is simply how Pascal works.
I once used Dec as a key for resource strings and the dec() function was no longer accessible
You could have just used
System.Dec as is the case for any symbol hidden in this way.