CodeTools see generics as an error
Original Reporter info from Mantis: sysrpl
-
Reporter name: Anthony Walter
Original Reporter info from Mantis: sysrpl
- Reporter name: Anthony Walter
Description:
Here is a video of the problem with CodeTools:
http://cache.getlazarus.org/video/bare_game_code_tools.mp4
When declaring a class with a generic interface referencing itself e.g. TPen = class(TGraphicsObject&LtPos;TPen>) anytime code insight is invoke CodeTools displays and error in the and jumps to the class definition.
What should happen is that CodeTools sees a line such as:
Pen.Color := clRed;
As valid syntax, and provide a proper class insight dropdown when a user types:
Pen.[ctrl + space]
Steps to reproduce:
program test;
{$mode delphi}
type
TClone<T> = interface
['{627A8DA1-504B-456B-A26F-B2ED358BA171}']
function Clone: T;
end;
TGraphicObject<T> = class(TInterfacedObject, TClone<T>)
function Clone: T; virtual; abstract;
end;
TPen = class;
TPen = class(TGraphicObject<TPen>)
function Clone: TPen; override;
end;
function TPen.Clone: TPen;
begin
Result := TPen.{<- press ctrl space here for code tools error}Create;
end;
begin
end.
Mantis conversion info:
- Mantis ID: 27847
- Build: trunk
- Platform: All
- Version: 1.5 (SVN)
- Monitored by: » @martok (Martok), » doconnor (Darwin O'Connor)