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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8e1f7d0039a97c6a X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Ambiguous character literals Date: 1999/04/26 Message-ID: <372486E1.CCAFF22A@averstar.com>#1/1 X-Deja-AN: 471078004 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <7fr2hr$sak$1@nnrp1.dejanews.com> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-04-26T00:00:00+00:00 List-Id: 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