From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Ambiguous expressions - Help! Date: Tue, 24 Sep 2013 11:37:21 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 24 Sep 2013 18:37:23 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="5a64620cc83ca47629e9cd617d12fc26"; logging-data="32446"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19E3OpSy4p4iTQcFjqmyIxIuKSItiGA8LU=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: Cancel-Lock: sha1:ENuFYbzEWviRl9EQuUz/ECifarU= Xref: news.eternal-september.org comp.lang.ada:17262 Date: 2013-09-24T11:37:21-07:00 List-Id: 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