FPC 3.0.4 compiles this code excerpt without a murmur:

== code ==

{$mode objfpc}{$H+}

type

  TSheetInfo = record
    name: String;
    tab: String;
    title: String;
    kind: TSheetKind; // an enumeration
    color: TColor;
  end;

  TBaseSheet = class(TTabSheet)
  protected
    FSheetInfo:      TSheetInfo;
    ...
  public
    constructor Create(aComponent: TComponent; aSheetInfo: TSheetInfo); virtual; reintroduce;
    ...
    property SheetKind: TSheetKind read FSheetInfo.kind;  // <<
  end;

  TEntryGrid = class(TCustomStringGrid)
  private
    FParentSheet: TBaseSheet;
    ...
  public
    constructor Create(AOwner: TComponent; aParentSheet: TBaseSheet); reintroduce;
    ...
    property SheetKind: TSheetKind read FParentSheet.FSheetInfo.kind; // <<
  end;

== code end ==

However, more recent FPCs (and trunk) reject this at the properties (marked above <<) with the error "Record or object type expected".

Is there a modeswitch or other wheeze that will get recent FPCs to accept dotted notation when specifying property read and write fields?



_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to