Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project1;
- {$APPTYPE CONSOLE}
- uses
- SysUtils;
- type
- TFoo = class
- public
- procedure Foo; virtual; abstract;
- end;
- TBar = class(TFoo)
- public
- procedure Foo; override;
- end;
- { TBar }
- procedure TBar.Foo;
- begin
- inherited Foo(); // <-- causes EAbstractError
- // inherited; // <-- No problem, everything works fine
- end;
- begin
- try
- with TBar.Create() do
- begin
- Foo();
- Free();
- end;
- except
- on E: Exception do
- begin
- Writeln(E.ClassName, ': ', E.Message);
- Readln;
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement