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

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 X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...