Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2024-02

Missing documentation for changes in 3.3.1 - visibility of class fields

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb

The code below (avail as download, wrongly reported at https://gitlab.com/freepascal.org/fpc/source/-/issues/40634#note_1777253148 => gen331_b.zip )
compiles in in 3.2.3, but not in 3.3.1

As for as I am concerned 3.3.1 is right. But should that change be mentioned on the user changes
https://wiki.freepascal.org/User_Changes_Trunk ?

---------------------------------------------------
program class_nest;
{$mode ObjFPC}{$H+}
uses unit1;
type
   TDataPointDistanceTool = class(TDataPointTool) //   not inheriting
from the nested class
   strict protected
     function FindRef(ADest: TDataPointTool.TPointRef): Boolean;
   end;
function TDataPointDistanceTool.FindRef(ADest:
TDataPointTool.TPointRef): Boolean;
begin
   ADest.FGraphPos := 1;
end;
begin
end.
---------------------------------------------------
unit Unit1;
{$mode ObjFPC}{$H+}
interface
uses
   Classes, SysUtils;
type

  TDataPointTool = class
  public
  type
    TPointRef = class
    private
    protected
      FGraphPos: integer; // It is protected
    end;
  end;

implementation
end.

Reply by email