Set of Enumerations

Issue #240 resolved
Toky Olivier Razanakotonarivo created an issue

I cannot compile the code bellow in DWS:

type 
  TEnum = (eOne = 1, eTwo, eThree, eFor);

type
  TEnumSet = set of TEnum;

type  
  TMyClass = class
  private 
    v: Set of TEnum;
    procedure setEnum(value: TEnumSet);
    function getEnum(): TEnumSet;
  public
    property Val: Set of TEnum read getEnum write setEnum;
  end;

  procedure TMyClass.setEnum(value: TEnumSet);
  begin
    v:= value;
  end;

  function TMyClass.getEnum(): TEnumSet;
  begin
    result := v;
  end;

Output is:

Syntax Error: Field/method "getEnum" has an incompatible type
Syntax Error: Method "setEnum" has incompatible parameters

Comments (3)

  1. Log in to comment