View Issue Details

IDProjectCategoryView StatusLast Update
0037262FPCCompilerpublic2020-06-26 07:12
Reporterdmz73 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSWindows 
Product Version3.2.0 
Summary0037262: Compiler selects function from parent class instead of generic child class
DescriptionWhen generic child class defines a function that exists in parent class with different parameters and this function is used in another generic class compiler uses the function from parent class and reports an error.
Steps To ReproduceCompile the following example project:

program Project1;

{$mode delphi}

uses unit1;

type
  { TClass1 }

  TClass1 = class
  public
    class function ToString<T>(A: T; B: string): string;
  end;

  { TClass2 }

  TClass2<T> = class
  public
    class function Test(A: T): string;
  end;

{ TClass1 }

class function TClass1.ToString<T>(A: T; B: string): string;
begin end;

{ TClass2 }

class function TClass2<T>.Test(A: T): string;
begin
  result := ' ' + TClass1.ToString<T>(A, '');
end;

begin

end.
Tagsgenerics
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-06-26 06:21 dmz73 New Issue
2020-06-26 07:12 Cyrax Tag Attached: generics