[Lazarus] Is this normal or bug ?

Howard Page-Clark hdpc at talktalk.net
Sat Aug 2 12:09:02 CEST 2014


On 02/08/2014 10:41, FreeMan wrote:
>    Tmy_Form = class(TForm)
>    private
>      { private declarations }
>       v1:integer;
>       v2:string;
>    public
>      { public declarations }
>      function exmple(v1:integer;v2:string):boolean;
>    end;
>
> when compile:
>
> xx.pas(8,21) Error: Duplicate identifier "v1"
> xx.pas(8,32) Error: Duplicate identifier "v2"
>
> first definition main class's variable, compiler error in function
> parameter "Duplicate identifier" is it normal or bug?

It is a feature of {$mode objfpc}, not a bug.
If you don't like the feature, use {$mode delphi} which allows such 
duplicate identifiers (and some other Delphi sloppiness).





More information about the Lazarus mailing list