{ %NORUN } program tw23279; {$MODE DELPHI} type TPolicy = class abstract procedure Z(const a: T); virtual; abstract; end; TWrapper = class private FPolicy: TPolicy; public constructor Create(policy: TPolicy); procedure W(const a: T); end; TSpecialWrapper = class(TWrapper) strict private type TSpecialPolicy = class(TPolicy) procedure Z(const a: Integer); override; end; public constructor Create; destructor Destroy; override; end; { TWrapper } constructor TWrapper.Create; begin end; procedure TWrapper.W(const a: T); begin FPolicy.Z(a); end; { TSpecialWrapper.TSpecialPolicy } procedure TSpecialWrapper.TSpecialPolicy.Z(const a: Integer); begin Writeln(a); end; { TSpecialWrapper } constructor TSpecialWrapper.Create; begin inherited Create(TSpecialPolicy.Create); { Warning: Constructing a class "TSpecialPolicy" with abstract method "Z"; if Z() is CLASS or CLASS STATIC the warning is suppressed but the code is still faulty } end; destructor TSpecialWrapper.Destroy; begin FPolicy.Free; end; begin with TSpecialWrapper.Create do begin W(0); Free; end; end.