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