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