comp.lang.ada
 help / color / mirror / Atom feed
From: cryintothebluesky@gmail.com
Subject: ambiguous expression (cannot resolve "Put")
Date: Sat, 27 Jul 2019 00:32:03 -0700 (PDT)
Date: 2019-07-27T00:32:03-07:00	[thread overview]
Message-ID: <64bf79fa-b330-416f-9deb-de3f0830d994@googlegroups.com> (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

             reply	other threads:[~2019-07-27  7:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-27  7:32 cryintothebluesky [this message]
2019-07-27  8:28 ` ambiguous expression (cannot resolve "Put") J-P. Rosen
2019-07-27  9:09   ` cryintothebluesky
replies disabled

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