[fpc-pascal] with in classes/records

Ryan Joseph ryan at thealchemistguild.com
Fri Sep 14 11:01:00 CEST 2018


Is a + operator that returns something other than the record valid?

I tried doing that but I get an error.

type
	TWrapper = record
		class operator + (left: TWrapper; right: integer): integer;
	end;

var
	wrapper: TWrapper;
	i: integer;
begin
	i := wrapper + 1;  // ERROR: "TWrapper" expected “LongInt” 

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list