CodeTools code creation creates invalid code on indexed properties with index
Original Reporter info from Mantis: kluug.net @onpok
-
Reporter name: Ondrej Pokorny
Original Reporter info from Mantis: kluug.net @onpok
- Reporter name: Ondrej Pokorny
Description:
Codetools fail on such properties:
property MyProp[const ItemIndex: Integer]: TObject index otOne read GetMyProp;
Steps to reproduce:
Run Ctrl+Shift+C on "|":
program Project1;
type
TMyObjType = (otOne, otTwo);
TMyObj = class
public
property |MyProp[const ItemIndex: Integer]: TObject index otOne read GetMyProp;
end;
begin
end.
You get:
function GetMyProp(AIndex: TMyObjType; const ItemIndex: Integer): TObject;
on which FPC fails with "project1.lpr(10,82) Error: Illegal symbol for property access"
Correct is:
function GetMyProp(const ItemIndex: Integer; AIndex: TMyObjType): TObject;
Mantis conversion info:
- Mantis ID: 31793
- Assignee Gitlab user: @PascalRiekenberg
- Assignee Mantis username: PascalR
- Assignee name: Pascal Riekenberg
- Version: 1.9 (SVN)