[fpc-pascal] as keyword behaivor

Matthias K. makadev at googlemail.com
Fri Sep 11 19:40:29 CEST 2009


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;
end;

--

regards,
  maka



More information about the fpc-pascal mailing list