[fpc-devel] Missing documentation for changes in 3.3.1 - visibility of class fields

Martin Frb lazarus at mfriebe.de
Sat Feb 17 22:54:28 CET 2024


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.



More information about the fpc-devel mailing list