Compiler reports error "Can't determine which overloaded function to call" when one parameter is generic
Original Reporter info from Mantis: dmz73 @dmz73
-
Reporter name:
Original Reporter info from Mantis: dmz73 @dmz73
- Reporter name:
Description:
Generic record contains overloaded procedure where number of parameters is the same and one parameter in one procedure is generic.
Calling this procedure from within the record results in error "Can't determine which overloaded function to call".
This same code compiles in Delphi.
Steps to reproduce:
Compile the following example project:
program Project1;
{$mode delphi}
type
TRec<T> = record
public
procedure SetRec(A1: boolean; A2: string); overload;
procedure SetRec(A1: boolean; A4: T); overload;
procedure Test;
end;
procedure TRec<T>.SetRec(A1: boolean; A2: string);
begin end;
procedure TRec<T>.SetRec(A1: boolean; A4: T);
begin end;
procedure TRec<T>.Test;
begin
Self.SetRec(true, default(T)); // error is reported here
end;
begin
end.
Additional information:
I have tried to compile the example project in the latest trunk version and it still reports the same error.
Mantis conversion info:
- Mantis ID: 37259
- OS: Windows
- OS Build: 10
- Platform: x86_64
- Version: 3.2.0