HomeDelphiDelphi Error – E2274 property attribute ‘label’ cannot be used in dispinterface

Delphi Error – E2274 property attribute ‘label’ cannot be used in dispinterface

Delphi Compiler Error

E2274 property attribute ‘label’ cannot be used in dispinterface

Reason for the Error & Solution

You have added a label to a property defined in a dispinterface, but this is disallowed by the language definition.

program Problem;

  type
    T0 = dispinterface
      ['{15101510-1510-1510-1510-151015101510}']
      function R : Integer;
      property value : Integer label 'Key';
    end;

begin
end.

Here an attempt is made to use a label attribute on a dispinterface property.

program Solve;

  type
    T0 = dispinterface
      ['{15101510-1510-1510-1510-151015101510}']
      function R : Integer;
      property value : Integer;
    end;

begin
end.


The only solution to this problem is to remove label attribute from the property definition.

Share:

Leave a Reply

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