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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-03 06:48:39 PST Path: archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: rod@praxis-cs.co.uk (Rod Chapman) Newsgroups: comp.lang.ada Subject: Operator visibility question Date: 3 Jun 2001 06:48:39 -0700 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 193.114.91.187 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 991576119 6126 127.0.0.1 (3 Jun 2001 13:48:39 GMT) X-Complaints-To: groups-support@google.com NNTP-Posting-Date: 3 Jun 2001 13:48:39 GMT Xref: archiver1.google.com comp.lang.ada:8036 Date: 2001-06-03T13:48:39+00:00 List-Id: 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