fork(1) download
  1. With Ada.Text_IO; Use Ada.Text_IO;
  2. With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
  3.  
  4. procedure Program is
  5.  
  6. package MyClass1 is
  7. type Class is tagged
  8. record
  9. i: integer;
  10. end record;
  11.  
  12. procedure Foo(self: in out Class) is
  13. begin
  14. Put_Line("foo");
  15. end;
  16. end;
  17.  
  18. package MyClass2 is
  19. type MyClass2 is new MyClass1 with null record;
  20.  
  21. procedure Foo(self: in out MyClass2) is
  22. begin
  23. Put_Line("foobar");
  24. end;
  25. end;
  26.  
  27. object_storage: MyClass2;
  28. object: MyClass1'class := object_storage;
  29. begin
  30. object.Foo;
  31. end Program;
Compilation error #stdin compilation error #stdout 0s 5812KB
stdin
Standard input is empty
compilation info
gcc-5 -c -pipe -O2 test.adb
test.adb:12:11: proper body not allowed in package spec
test.adb:21:11: proper body not allowed in package spec
gnatmake: "test.adb" compilation error
stdout
Standard output is empty