View Issue Details

IDProjectCategoryView StatusLast Update
0031793LazarusPackagespublic2020-07-30 09:40
ReporterOndrej Pokorny Assigned ToPascal Riekenberg  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version1.9 (SVN) 
Summary0031793: CodeTools code creation creates invalid code on indexed properties with index
DescriptionCodetools fail on such properties:

property MyProp[const ItemIndex: Integer]: TObject index otOne read GetMyProp;
Steps To ReproduceRun 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;
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

related to 0036189 new Wrong hint for indexed properties 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2017-05-10 20:02 Ondrej Pokorny New Issue
2019-10-15 23:43 Juha Manninen Relationship added related to 0036189
2020-07-30 09:40 Pascal Riekenberg Assigned To => Pascal Riekenberg
2020-07-30 09:40 Pascal Riekenberg Status new => assigned