comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Ambiguous character literals
Date: 1999/04/26
Date: 1999-04-26T00:00:00+00:00	[thread overview]
Message-ID: <372486E1.CCAFF22A@averstar.com> (raw)
In-Reply-To: 7fr2hr$sak$1@nnrp1.dejanews.com

adam@irvine.com wrote:
> 
> I think this program should fail to compile, but GNAT 3.10 doesn't give
> any error messages.  Am I interpreting the RM correctly?  Or is there
> some nuance I'm missing in the RM that causes STANDARD.CHARACTER to be
> preferred in a case like this?
> 
> Also, I think the program should still be illegal if one or both of the
> enumeration type declarations is deleted (since "<" is still visible for
> CHARACTER and WIDE_CHARACTER).  Is my understanding correct?

Your understanding is correct.  It seems that your version
of GNAT is being a bit too friendly.

Here is the error message our compiler gives:

    6     b := ('d' < 'b');
                    *
*****Error: The expression is ambiguous, Continuing
 
> 
>                                 -- thanks, Adam
> 
> procedure test is
>     type etype is ('d', 'c', 'b', 'a');
>     type etype2 is ('a', 'b', 'c', 'd');
>     b : boolean;
> begin
>     b := ('d' < 'b');
> end test;

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  reply	other threads:[~1999-04-26  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-24  0:00 Ambiguous character literals adam
1999-04-26  0:00 ` Tucker Taft [this message]
1999-04-28  0:00 ` Robert Dewar
replies disabled

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