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

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

The CLR requires that property accessors be methods, not fields. The Object Pascal language allows you to specify fields as property accessors. The Object Pascal 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 Object Pascal 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.