Property accessors cannot used subranged enumeration as indexers (Delphi mode)
Original Reporter info from Mantis: smcilwain
-
Reporter name: Sean J McIlwain
Original Reporter info from Mantis: smcilwain
- Reporter name: Sean J McIlwain
Description:
In delphi mode, the following code gives the error with fpc
bug.pas(16,54) Error: Illegal symbol for property access
bug.pas(16,67) Error: Illegal symbol for property access
bug.pas(17,54) Error: Illegal symbol for property access
bug.pas(17,67) Error: Illegal symbol for property access
bug.pas(18,54) Error: Illegal symbol for property access
bug.pas(18,67) Error: Illegal symbol for property access
{$MODE DELPHI}
unit bug;
interface
type
TEnum = (e1, e2, e3, e4);
TEnumer = e1..e3;
TTest = class
private
function GetData(AType : TEnumer): Cardinal;
procedure SetData(AType : TEnumer; AValue: Cardinal);
published
property E1Data : Cardinal index e1 read GetData write SetData;
property E2Data : Cardinal index e2 read GetData write SetData;
property E3Data : Cardinal index e3 read GetData write SetData;
end;
implementation
function TTest.GetData(AType : TEnumer): Cardinal;
begin
end;
procedure TTest.SetData(AType : TEnumer; AValue: Cardinal);
begin
end;
end.
This compiles fine on delphi.
Mantis conversion info:
- Mantis ID: 11792
- Monitored by: » smcilwain (Sean J McIlwain)