comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Ambiguous expressions - Help!
Date: Tue, 24 Sep 2013 11:37:21 -0700
Date: 2013-09-24T11:37:21-07:00	[thread overview]
Message-ID: <l1sm51$vlu$1@dont-email.me> (raw)
In-Reply-To: <L3+qKwCa4cQSFwx2@ada-augusta.demon.co.uk>

On 09/24/2013 10:38 AM, Mike H wrote:
>
> Compilation of Foo3 raises error messages of the form "ambiguous
> expression (cannot resolve "Put_line")
>
> I find it hard to believe that the compiler cannot distinguish between a
> string and an array of characters. What am I doing wrong?

Any one-dimensional array with components of a character type is a string type. 
Every string type has corresponding literals. String is a string type, but one 
can declare other string types.

Grid_Type is a string type, and "Something else" may be a literal of type 
Grid_Type. It might also be a literal of type String. Hence the compiler cannot 
determine which Put_Line is intended. You can help it by writing

Foo2.Put_Line (Item => Foo1.Grid_Type'("Something else") );

(unless you meant the other Put_Line).

-- 
Jeff Carter
"He didn't get that nose from playing ping-pong."
Never Give a Sucker an Even Break
110

  parent reply	other threads:[~2013-09-24 18:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 17:38 Ambiguous expressions - Help! Mike H
2013-09-24 18:15 ` Eryndlia Mavourneen
2013-09-24 18:43   ` Adam Beneschan
2013-09-24 20:34     ` Robert A Duff
2013-09-24 18:37 ` Jeffrey Carter [this message]
2013-09-24 21:08 ` Georg Bauhaus
2013-09-25  7:14 ` Mike H
replies disabled

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