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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,77f1de37204ed8a6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-03 07:19:59 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!chnws02.mediaone.net!chnws06.ne.mediaone.net!24.91.0.34!typhoon.ne.mediaone.net.POSTED!not-for-mail From: "Jeff Creem" Newsgroups: comp.lang.ada References: Subject: Re: Operator visibility question X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Sun, 03 Jun 2001 14:19:58 GMT NNTP-Posting-Host: 24.147.117.96 X-Complaints-To: abuse@mediaone.net X-Trace: typhoon.ne.mediaone.net 991577998 24.147.117.96 (Sun, 03 Jun 2001 10:19:58 EDT) NNTP-Posting-Date: Sun, 03 Jun 2001 10:19:58 EDT Organization: Road Runner Xref: archiver1.google.com comp.lang.ada:8037 Date: 2001-06-03T14:19:58+00:00 List-Id: I really should be quoting LRM paragraphs when I say something like this but it seems to me that GNAT is wrong here since < is not visible and I can not think of any reason why it should be visible. It seems that if both sides of the < are MT.T GNAT does detect it but if one side is universal integer it does not. It is times like this that I miss Robert Dewar! Jeff "Rod Chapman" wrote in message news:ba18d5cb.0106030548.62aa45e2@posting.google.com... > Can anyone please tell me if the following code is legal? > > package MT > is > type T is range 0 .. 4; > end MT; > > with MT; > --# inherit MT; > package VT > is > function "+" (Left, Right : in MT.T) return MT.T renames MT."+"; > A : constant := 2; > B : constant MT.T := 3; > > C : constant Boolean := (A + 2) < B; -- Is "<" visible here? > end VT; > > The SPARK Examiner rejects the declaration of C with the message: > > 9 C : constant Boolean := (A + 2) < B; -- Is "<" visible here? > ^ > *** Semantic Error :309: Operator not visible for these types. > > On the other hand, GNAT 3.13 accepts the code with no errors. Can anyone > explain which is right, and (more importantly) why? > Cheers, > Rod Chapman > SPARK Team > Praxis Critical Systems