Generics cannot have overloaded methods with parameters of yet undefined type
Original Reporter info from Mantis: SIV
-
Reporter name: Igor Sudarikov
Original Reporter info from Mantis: SIV
- Reporter name: Igor Sudarikov
Description:
FPC fails to compile the following code:
type
generic GSomething<TSomeType> = class
procedure Method(i :Integer);
procedure Method(s :TSomeType);
end;
procedure GSomething.Method(i: Integer);
begin
end;
procedure GSomething.Method(s: TSomeType);
begin
end;
begin
end.
with message "test.pas(4,15) Error: Function is already declared Public/Forward "GSomething.Method(&LtPos;undefined type>);"
The error should occur only when specializing this generic type with TSomeType=Integer
Mantis conversion info:
- Mantis ID: 15683
- Build: 14777
- Version: 2.5.1
- Fixed in version: 3.0.0
- Fixed in revision: 21450 (#a7f95382)
- Monitored by: » Basil Peace (Basil Peace), » kyan (Constantine Yannakopoulos)