I have a record with methods that is a template, this produces various failures in codetools in lazarus ide, freepascal compiler compiles this nicely, but codetools complains on definition line, that: "Error: expected =, but < found"
All neccesary compiler defines are in place, for templates to work.
Template:
IRectT<T> = packed record
private
function getheight: T;
function getwidth: T;
procedure setheight(AValue: T);
procedure setwidth(AValue: T);
public
Left,
Top,
Right,
Bottom: T; // todo: int64
function same(b : IRectT<T>) : boolean; inline;
function contains(b : IRectT<T>) : boolean; inline;
procedure blank;
function IsBlank: boolean;
class function buildrect(const aleft, atop, aright, abottom: T): IRectT<T>; static;
class function buildrectWH(const aleft, atop, aWidth, aheight: T): IRectT<T>; static;
procedure Center(const withrect: IRectT<T>; centerv, centerh: boolean); inline;
function CalcAspectRatio(const fitinto: IRectT<T>): IRectT<T>;
function tostring(): widestring;
procedure Combine(const second: IRectT<T>); inline;
procedure Trim(const second: IRectT<T>); inline;
procedure IncludePoint(const pointx, pointy: T);
procedure inflateMe(const delta: T); overload; inline;
function Inflate(const delta: T): IRectT<T>; overload; inline;
function Dimensions(): BigIntVector; inline;
function CalculateArea(): T; inline;
procedure constrain(const minx, miny, maxx, maxy: T); inline;
procedure moveTo(const x,y: T); inline;
procedure moveby(const x,y: T); inline;
procedure scalediv(const bx, by: single); inline;
function squarearea(): T;
property width: T read getwidth write setwidth;
property height: T read getheight write setheight;
property x: T read left;
property y: T read top;
class Operator = (A : IRectT<T>; B : IRectT<T>) C : boolean;
end;
IRect = IRectT<int32>;
IRect32 = IRectT<int32>;