comp.lang.ada
 help / color / mirror / Atom feed
* Operator visibility question
@ 2001-06-03 13:48 Rod Chapman
  2001-06-03 14:19 ` Jeff Creem
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Rod Chapman @ 2001-06-03 13:48 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-06-05 12:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-03 13:48 Operator visibility question Rod Chapman
2001-06-03 14:19 ` Jeff Creem
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

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