E2562 Field identifier required (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Error and Warning Messages (Delphi)

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.