Delphi Compiler Error
E2562 Field identifier required
Reason for the Error & Solution
This occurs when defining a property on a class member that is not a field.
program E2562;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
TRec = record
F: Integer;
function Func1: Integer;
end;
function TRec.Func1: Integer;
begin
Result := F;
end;
type
TClass = class
private
Field: TRec;
public
property Prop: String read Field.Func1;//E2562
end;
begin
end.