Delphi Error – E2392 Can’t generate required accessor method(s) for property %s.%s due to name conflict with existing symbol %s in the same scope

Delphi Compiler Error

E2392 Can’t generate required accessor method(s) for property %s.%s due to name conflict with existing symbol %s in the same scope

Reason for the Error & Solution

The CLR requires that property accessors be methods, not fields. The Delphi language allows you to specify fields as property accessors. The Delphi compiler will generate the necessary methods behind the scenes. CLS recommends a specific naming convention for property accessor methods: get_propname and set_propname. If the accessors for a property are not methods, or if the given methods do not match the CLS name pattern, the Delphi compiler will attempt to generate methods with CLS conforming names. If a method already exists in the class that matches the CLS name pattern, but it is not associated with the particular property, the compiler cannot generate a new property accessor method with the CLS name pattern.

If the given property’s accessors are methods, name collisions prevent the compiler from producing a CLS conforming name, but does not prevent the property from being usable.

However, if a name conflict prevents the compiler from generating an accessor method for a field accessor, the property is not usable and you will receive this error.

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...