Delphi Error – E2186 Published Real property ‘%s’ must be Single, Real, Double or Extended

Delphi Compiler Error

E2186 Published Real property ‘%s’ must be Single, Real, Double or Extended

Reason for the Error & Solution

You have attempted to publish a property of type Real, which is not allowed. Published floating point properties must be Single, Double, or Extended.

program Produce;
  type
    Base = class
      R : Real48;
    published
      property RVal : Real read R write R;
    end;
end.

The published Real48 property in the program above must be either removed, moved to an unpublished section or changed into an acceptable type.

program Produce;
  type
    Base = class
      R : Single;
    published
      property RVal : Single read R write R;
    end;
end.

This solution changed the property into a real type that will actually produce run-time type information.

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