[fpc-pascal] Re: as keyword behaivor

Matthias K. makadev at googlemail.com
Fri Sep 11 19:48:38 CEST 2009


Sorry for double post, just for correction

On Fri, Sep 11, 2009 at 7:40 PM, Matthias K. <makadev at googlemail.com> wrote:
> Hi,
>
> Its quite a while since i last used the "as" Keyword but it seems to
> be broke somehow.
> In the following code i've got a compiler error: Illegal parameter
> list in the line with the star,
> at the opening Brace. A Cast ( T8BSetObject(ASet).FSet ... ) works fine.
> --
>
> type
>  TBaseSet = set of Char;
>  TSetObject = class
>    public
>      procedure Union( ASet: TSetObject ); virtual; abstract;
>  end;
>
>  T8BSetObject = class( TSetObject )
>    private
>      FSet: TBaseSet;
>    public
>      procedure Union( ASet: TSetObject ); override;
>  end;
> ..
> procedure T8BSetObject.Union( ASet: TSetObject ); override;
> begin
> *  Result := FSet + ( ASet as T8BSetObject).FSet;
FSet := FSet + (ASet as T8BSetObject );
.. it was just a fast rewrite of the actual code, dont mind other
faults. the problem line is here
> end;
>
> --
>
> regards,
>  maka
>



More information about the fpc-pascal mailing list