> On Jun 10, 2019, at 9:31 AM, Sven Barth via fpc-devel 
> <[email protected]> wrote:
> 
> The +-operator is not defined internally thus it is allowed to be overloaded. 
> (is it really that hard to understand? If you can use an operator in code 
> without declaring an operator overload then this operator is internal and not 
> allowed to be overloaded). 
> 

I get what you mean but I had no idea := with the destination variable was an 
operator.

I just tried this right now and I didn’t an error but it was indeed not 
overloaded and never got called. A bug?

operator := (left, right: TObject): TObject;
begin
  writeln('custom :=');
end;

var
  c: TObject;
begin
  c := TObject.Create;
end.


Regards,
        Ryan Joseph

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

Reply via email to