I'm working in XE7, and have found that if I declare a static class, then code completion presents the private field, rather than the public property. So with this:

I'm working in XE7, and have found that if I declare a static class, then code completion presents the private field, rather than the public property. So with this:

type
  TMyClass = class
  private
    class var
      FSomeField: string;
  public
    class property SomeField: string read FSomeField write FSomeField;
  end;

I will see in code completion, TMyClass.FSomeField. The field is private, of course, so code will not compile if it uses the field exposed in code completion. Making the field strict private does not change the behavior.

The only alternative I have thought of would be to use getters and setters for the properties, and make the data storage simple variables in the implementation section. I really don't want to explore that kind of kludge.

Is this a known error? I have not found it in QP. Or is there some syntactical trick to get around the problem?

Comments

  1. Lars Fosdal I have years of experience with CnPack, GExperts and MMX in an IDE. Admittedly, not in XE7. I have only a few months experience with Castalia, and if I need to start ripping things out, Castalia will be first to go.

    ReplyDelete
  2. I have a bit of plugin paranoia myself :)

    ReplyDelete
  3. Lars Fosdal I had noticed that. ;)

    ReplyDelete

Post a Comment