[fpc-devel] Fatal: Internal error 200111022
    Birger Jansen 
    birger at cnoc.nl
       
    Wed Oct 20 12:49:12 CEST 2010
    
    
  
I'm not sure if this is the correct way to report this, please correct me if I should report in another way.
I found an old conversation between Leonardo and Florian about the Fatail internal error 200111022. The thread concluded that they could not reproduce the error.
I got this error while converting a large project from Delphi to FPC. It turns out that a base class has a property Count, and a derived class has a function with the same name Count. This will compile, untill you call the property or function Count. 
I created an example that should explain it. Uncomment the marked line to get the fatal internal error:
program project1;
{$mode objfpc}{$H+}
uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes;
type
  TBase = class
  private
    function GetCount: Integer;
  public
    property Count: Integer read GetCount;
  end;
  TSub = class(TBase)
  public
    function Count: Integer; overload;
  end;
function TSub.Count: Integer;
begin
  Result := 0;
end;
{ TBase }
function TBase.GetCount: Integer;
begin
  Result := 0;
end;
var
  MySub: TSub;
  i : Integer;
begin
  MySub := TSub.Create;
// uncomment the next line for Fatal Internal error 200111022:
//  for i := 0 to MySub.Count do begin end;
end.
    
    
More information about the fpc-devel
mailing list