On 31/07/2011 15:14, Hans-Peter Diettrich wrote:
Martin schrieb:
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

What's "new" with that type? Where is it declared?
It's not about the type. It applies to just any type. declare your own "Complex" or use "TFoo"


Operator := (C : Complex) z : complex;

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

The example doesn't declare an new type "Complex", so that most probably that already existing type already *has* operators - and accordingly the compiler doesn't allow to redefine these operators.
See above, same for TFoo.


_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to