[fpc-devel] operator ovelroading documentation

Martin lazarus at mfriebe.de
Sun Jul 31 13:29:46 CEST 2011


http://www.freepascal.org/docs-html/ref/refse68.html#x164-17400012.3

the first ( of several) examples on that page is

> Var
>   C,Z : Complex; // New type complex
>
> begin
>   Z:=C;  // assignments between complex types.
> end;
>
> The following assignment operator would have to be defined:
>
> Operator := (C : Complex) z : complex;

However, the compiler rejects that with:
project1.lpr(10,38) Error: Impossible to overload assignment for equal types




More information about the fpc-devel mailing list