fork download
  1. with Ada.Exceptions;
  2. with Ada.Text_IO;
  3.  
  4. procedure Test is
  5. type Animal is range 1 .. 42;
  6. subtype Fish is Animal range 2 .. 30;
  7. subtype Shark is Fish range 10 .. 20;
  8. F : Fish;
  9. S : Shark;
  10. begin
  11. S := S * F;
  12. exception
  13. when E : others =>
  14. Ada.Text_IO.Put_Line(Ada.Exceptions.Exception_Message(E));
  15. end Test;
Success #stdin #stdout 0s 18048KB
stdin
Standard input is empty
stdout
test.adb:11 range check failed