generic function fails to recognize type and reports error Operator is not overloaded
Original Reporter info from Mantis: dmz73 @dmz73
-
Reporter name:
Original Reporter info from Mantis: dmz73 @dmz73
- Reporter name:
Description:
Generic function that uses the result of another generic function that returns a concrete type fails to recognize that type and instead tries to use the class type.
Steps to reproduce:
program Project1;
{$mode delphi}
type
{ TC1 }
TC1 = class
class function ToInt32<T>(const a: T): int32; static; inline;
end;
{ TC2 }
TC2 = class
class procedure Mul<T>(var a: int32; const b: T); static; inline;
end;
{ TC1 }
class function TC1.ToInt32<T>(const a: T): int32;
begin end;
{ TC2 }
class procedure TC2.Mul<T>(var a: int32; const b: T);
begin
a := a * TC1<T>.ToInt32(b); // Error: Operator is not overloaded: "LongInt" * "Class Of TC1"
end;
begin
end.
Mantis conversion info:
- Mantis ID: 37298
- OS: Windows
- OS Build: 10
- Platform: x86_64
- Version: 3.3.1