Fatal compiler error 200111022
Original Reporter info from Mantis: birger
-
Reporter name: B. Jansen
Original Reporter info from Mantis: birger
- Reporter name: B. Jansen
Description:
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.
Steps to reproduce:
Uncomment the marked line in the following code and compile:
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.
Additional information:
The compiler should select TSub.Count (see example).
Fix as suggested in Delphi mode
Prohibit in ObjFPC mode
Mantis conversion info:
- Mantis ID: 17675
- Version: 2.4.3
- Fixed in version: 2.6.0
- Fixed in revision: 16191 (#5e84c557)