comp.lang.ada
 help / color / mirror / Atom feed
* ambiguous expression (cannot resolve "Put")
@ 2019-07-27  7:32 cryintothebluesky
  2019-07-27  8:28 ` J-P. Rosen
  0 siblings, 1 reply; 3+ messages in thread
From: cryintothebluesky @ 2019-07-27  7:32 UTC (permalink / raw)


Hi, could anyone suggest how to print 'Size attribute for various integers? There seems to be an issue with overloaded Put() function. Not sure why only 'Size attribute causes this issue, other attributes like 'First and 'Last seem OK. I suppose I could do something like Ada.Integer_Text_IO.Put() and Ada.Short_Integer_Text_IO.Put() but this doesn't look very nice. 


with Ada.Text_IO;               use Ada.Text_IO;
with Ada.Integer_Text_IO;       use Ada.Integer_Text_IO;
with Ada.Short_Integer_Text_IO; use Ada.Short_Integer_Text_IO;

procedure Integer_Types is
begin
	Put("Integer'Size        "); Put(Integer'Size); New_Line;
	Put("Integer'First       "); Put(Integer'First); New_Line;
	Put("Integer'Last        "); Put(Integer'Last); New_Line;

	Put("Short_Integer'Size  "); Put(Short_Integer'Size); New_Line;
	Put("Short_Integer'First "); Put(Short_Integer'First); New_Line;
	Put("Short_Integer'Last  "); Put(Short_Integer'Last); New_Line;
end Integer_Types;


Compile
   [Ada]          integer_types.adb
integer_types.adb:13:38: ambiguous expression (cannot resolve "Put")
integer_types.adb:13:38: possible interpretation at a-tiinio.ads:66, instance at a-siteio.ads:18
integer_types.adb:13:38: possible interpretation at a-tiinio.ads:66, instance at a-inteio.ads:18
integer_types.adb:17:38: ambiguous expression (cannot resolve "Put")
integer_types.adb:17:38: possible interpretation at a-tiinio.ads:66, instance at a-siteio.ads:18
integer_types.adb:17:38: possible interpretation at a-tiinio.ads:66, instance at a-inteio.ads:18
gprbuild: *** compilation phase failed

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-27  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-27  7:32 ambiguous expression (cannot resolve "Put") cryintothebluesky
2019-07-27  8:28 ` J-P. Rosen
2019-07-27  9:09   ` cryintothebluesky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox