Skip to content

Error: There is no method in an ancestor class to be overridden

FPC [main]


Compile #1 (OK): fpc.exe -n -FuC:\fpclaztrunk\fpc\units\x86_64-win64\rtl groupresource2.pp
Compile #2 (🐞FAIL): fpc.exe -n -FuC:\fpclaztrunk\fpc\units\x86_64-win64\rtl groupresource2.pp

Output:

groupresource2.pp(11,17) Error: There is no method in an ancestor class to be overridden: "constructor Create(TAbstractResource);"
groupresource2.pp(14,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

groupcursorresource2.pp:

unit groupcursorresource2;
{$MODE OBJFPC}

interface

uses
  groupresource2;

implementation
end.

groupresource2.pp:

unit groupresource2;
{$MODE OBJFPC}

interface

uses
  resource2, resdatastream2;

type
  TGroupCachedDataStream = class(TCachedDataStream)
    constructor Create(aResource : TAbstractResource); override;
  end;

implementation

constructor TGroupCachedDataStream.Create(aResource : TAbstractResource);
begin
end;

end.

resdatastream2.pp:

unit resdatastream2;
{$MODE OBJFPC}

interface

uses
  resource2;

type
  TCachedDataStream = class
    constructor Create(aResource : TAbstractResource); virtual;
  end;

implementation

constructor TCachedDataStream.Create(aResource : TAbstractResource);
begin
end;

end.

resmerger2.pp:

unit resmerger2;
{$MODE OBJFPC}

interface

uses
  resource2,
  groupcursorresource2
  ;

var
  Merge: TAbstractResource;

implementation
end.

resource2.pp:

unit resource2;
{$MODE OBJFPC}

interface

type
  TAbstractResource = class
  end;

implementation

uses
  resdatastream2,
  resmerger2
  ;

end.

Archive📚 : fpc_bug_src_.zip

This is some kind of floating error. Sometimes, during minimization, it would throw an Unhandled Exception, and sometimes it would throw an error as described

Based on:
#41439

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information