Recent

Author Topic: Effect of adding properties before the visibility sections?  (Read 2034 times)

n7800

  • Hero Member
  • *****
  • Posts: 596
  • Lazarus IDE contributor
    • GitLab profile
Re: Effect of adding properties before the visibility sections?
« Reply #15 on: January 14, 2026, 04:13:36 am »
No visibility specifier declared means section public see reference manual:
Quote
For objects, three visibility specifiers exist: private, protected and public. If a visibility specifier is not specified, public is assumed.

The documentation is not entirely accurate here. The default visibility section of a class is public, however if the class is compiled with $M+ or descends from one that has that enabled it then the default section is instead published.

The documentation for objects (which don't have a "published" section) is quoted. However, the documentation for classes also doesn't provide this clarification, so I've created a report on the bug tracker.

Personally, I've been missing this explanation for a long time, as in practice, I've sometimes seen evidence of both, but didn't understand how it worked.

 

TinyPortal © 2005-2018