tb0407.pp 620 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. { %version=1.1 }
  2. {$ifdef fpc}{$mode delphi}{$endif}
  3. var
  4. err : boolean;
  5. type
  6. tc1=class(tinterfacedobject)
  7. constructor Create;overload;
  8. constructor Create(s:string);overload;
  9. end;
  10. tc2=class(tc1)
  11. constructor Create(l1,l2:longint);overload;
  12. end;
  13. constructor tc1.create;
  14. begin
  15. err:=true;
  16. end;
  17. constructor tc1.create(s:string);
  18. begin
  19. err:=true;
  20. end;
  21. constructor tc2.create(l1,l2:longint);
  22. begin
  23. { The next line should do nothing }
  24. inherited;
  25. end;
  26. var
  27. c : tc2;
  28. begin
  29. err:=false;
  30. c:=tc2.create(1,1);
  31. c.free;
  32. if err then
  33. begin
  34. writeln('Error!');
  35. halt(1);
  36. end;
  37. end.