Compiler selects function from parent class instead of generic child class
Original Reporter info from Mantis: dmz73 @dmz73
-
Reporter name:
Original Reporter info from Mantis: dmz73 @dmz73
- Reporter name:
Description:
When 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 reproduce:
Compile 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.
Mantis conversion info:
- Mantis ID: 37262
- OS: Windows
- OS Build: 10
- Platform: x86_64
- Version: 3.2.0