E2515 Typparameter '%s' ist mit Typ '%s' nicht kompatibel (Delphi)

Aus RAD Studio
Wechseln zu: Navigation, Suche

Nach oben zu Fehler- und Warnungsmeldungen (Delphi) - Index

Dieser Fehler tritt auf, wenn der Objekttyp der Typeinschränkung kein konkreter Typ ist.


 program E2515;
 
 {$APPTYPE CONSOLE}
 
 uses
   SysUtils;
 
 type
   TMyConcreteClass = class
   end;
 
 type
   TMyData<T: TMyConcreteClass> = class(TObject)
   end;
 var
   mustBeConcreteType: TMyData<TObject>; //E2515 Fix: construct a class that wraps the TObject class and inherits its methods.
 
 begin
    Writeln('E2515 Type parameter ''%s'' is not compatible with type ''%s''');
 end.