fork download
  1. with Ada.Text_IO, Interfaces;
  2. use Ada.Text_IO, Interfaces;
  3.  
  4. procedure test is
  5. package Unsigned_16_IO is new Ada.Text_Io.Modular_IO(Unsigned_16);
  6. package Unsigned_32_IO is new Ada.Text_Io.Modular_IO(Unsigned_32);
  7. aa: Unsigned_16 := 1000;
  8. bb: Unsigned_16 := 6000;
  9. cc: Unsigned_32;
  10.  
  11. function xxfunc(x: Unsigned_32; y: Unsigned_32) return Unsigned_32 is
  12. begin
  13. return x + y;
  14. end xxfunc;
  15.  
  16. begin
  17. cc := xxfunc(aa, bb);
  18. Unsigned_16_IO.Put(aa, 1);
  19. Put(" + ");
  20. Unsigned_16_IO.Put(bb, 1);
  21. Put(" = ");
  22. Unsigned_32_IO.Put(cc, 1);
  23. New_Line;
  24. end test;
Compilation error #stdin compilation error #stdout 0s 4544KB
stdin
Standard input is empty
compilation info
x86_64-linux-gnu-gcc-8 -c -pipe -O2 test.adb
test.adb:17:17: expected type "Interfaces.Unsigned_32"
test.adb:17:17: found type "Interfaces.Unsigned_16"
x86_64-linux-gnu-gnatmake-8: "test.adb" compilation error
stdout
Standard output is empty