comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff Creem" <jeff@thecreems.com>
Subject: Re: Operator visibility question
Date: Sun, 03 Jun 2001 14:19:58 GMT
Date: 2001-06-03T14:19:58+00:00	[thread overview]
Message-ID: <iIrS6.18988$_Y5.3146404@typhoon.ne.mediaone.net> (raw)
In-Reply-To: ba18d5cb.0106030548.62aa45e2@posting.google.com

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" <rod@praxis-cs.co.uk> 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





  reply	other threads:[~2001-06-03 14:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-03 13:48 Operator visibility question Rod Chapman
2001-06-03 14:19 ` Jeff Creem [this message]
2001-06-03 15:47 ` Nacho Robledo
2001-06-03 20:15   ` Robert A Duff
2001-06-04 15:24     ` Rod Chapman
2001-06-04 17:55     ` Nacho Robledo
2001-06-04 21:27       ` Ted Dennison
2001-06-03 16:34 ` Florian Weimer
2001-06-04 15:52   ` Ted Dennison
2001-06-04 22:12     ` Florian Weimer
2001-06-05 12:24       ` Rod Chapman
2001-06-03 20:13 ` Robert A Duff
replies disabled

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