Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-08

Misleading Statement at Comparison Operator Description

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Daniel Gaspary

Hi,

I believe the statement[1] bellow is not accurate:

"The result type of a comparison operator is always a boolean."

Because this code compiles and works:

program Project1;
type
    TMyType1 = class(TObject);
    TMyType2 = class(TObject);
    TMyType3 = class(TObject);
    operator > (t1: TMyType1; t2: TMyType2): TMyType3;
    begin
         //some code...
    end;
var
   t3: TMyType3;
begin
     t3:=TMyType1.Create > TMyType2.Create;
end.

Am I Wrong, the documentation need fixing.. ?

Thank you.

[1] http://www.freepascal.org/docs-html/ref/refse93.html#x198-20800015.5

Reply by email