Delphi Error – H2505 ‘Self’ is uninitialized. An inherited constructor must be called before entering a try block

Delphi Compiler Error

H2505 ‘Self’ is uninitialized. An inherited constructor must be called before entering a try block

Reason for the Error & Solution

A constructor must always call an inherited constructor before it may access or initialize any inherited class members (such as specific exception handling). The compiler generates an error if your constructor code does not call the inherited constructor (a valid situation in Delphi for Win32), but it is important to examine your constructors to make sure that you do not access any inherited class fields, directly or indirectly, before the call to the inherited constructor.

Note: A constructor can initialize fields from its own class, prior to calling the inherited constructor.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...