[lazarus] Name Confilct in fpc
Florian Klaempfl
Florian.Klaempfl at gmx.de
Tue Feb 29 12:19:22 EST 2000
Michael Van Canneyt wrote:
> > The other thing I found after this which Delphi will happily handle
> > but which fpc throws up on.....
> >
> > type
> > TSomeObject = class(TObject)
> > private
> > FSomeVar: TSomeType;
> > ........
> > public
> > procedure DontWork(Dummy: String; SomeVar: TSomeType);
> > procedure ......
> > published
> > property SomeVar: TSomeType Read FSomeVar;
> > end;
> >
> > The Fix is easy...
> >
> > procedure DontWork(Dummy: String; aSomeVar: TSomeType);
>
> This is done deliberately. We feel that having the same name in a
> parameter of a method and a property name is very bad coding and
> should not be allowed. This is, of course, debatable since you could
> e.g. argue that the procedure starts a new scope, and that within
> this scope you can redefine any symbol etc etc etc...
>
But this would also apply for methods and fields but parameters
can't have the same name as methods and fields.
More information about the Lazarus
mailing list