Search code examples
delphidelphi-xe6

Delphi RAD Studio class completion issue


I can't invoke class completion (via Ctrl + Shift + C) using Embarcadero RAD Studio XE6, if I have following class structure. Program works fine, but the IDE causes the following error. If I want to use it, I must comment DescriptionArray, which is somewhat annoying.

Therefore I would like to know, if anyone knows, where is the problem, or what I'm doing wrong.

GT_Class = class
type
  TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
  TCustomSet = set of TCustomEnum;

const
  DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
end;

Error Message

Error message


Solution

  • Solved by Stefan Glienke in comment. Actually it's a bug in Delphi XE6 and in other versions it has been resolved. You need to define visibility, public in this case, even if it shouldn't be needed.

    GT_Class = class
    public
      type
        TCustomEnum = (ceValue1, ceValue2, ceValue3, ceValue4);
        TCustomSet = set of TCustomEnum;
    
      const
        DescriptionArray : array[TCustomEnum] of string = ('Description1', 'Description2', 'Description3', 'Description4');
    end;