Static class constructors (realted to: 2359, 2400)
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
"This construction is now forbidden (delphi compatible) as it is bogus" (from Comment of 2400 bug)
Actually, this is not a bogus - this is a missfeature. The only way to forbid static class constructors gracefully is to allow constant fields in classes (it's the way C++ solves this problem). Also 2 things may be usefull for it:
- static class constructor should be called automatically (while unit initialization) for each class defined in the unit
- if 1st is implemented - don't allow to call static constructor directly.
Thank you.
Additional information:
Reporter: Sergey Kosarevsky
EMail: netsurfer at au dot ru
Mantis conversion info:
- Mantis ID: 4575
- OS: All
- Version: 1.0.6