[fpc-devel] which constant expression?

Mario R. Carro mcarro at gmx.net
Sat May 26 23:40:12 CEST 2007


Hi. Why does this fail to compile with FPC 2.3.1? (from ZeosLib):

procedure TZExpression.SetTokenizer(Value: IZTokenizer);
var
  Parser: TZExpressionParser;
begin
  FTokenizer := Value;
  TZExpressionParser(FParser).Tokenizer := Value; // <-- This line fails
end;

FParser is declared as TObject and assigned a TZExpressionParser at runtime. 
Tokenizer is a property of TZExpressionParser of type IZTokenizer that gives 
direct access to the field FTokenizer of the same class.

The error message says:

ZExpression.pas(479,20) Error: Can't take the address of constant expressions

I googled a little and found that this error message is associated to trying 
to use a property as a var parameter or to try to modify a member of a value 
returned by a property, but this isn't any of those cases. May the problem be 
the property is of an interface type?

Thanks,
Mario



More information about the fpc-devel mailing list