From: rod@praxis-cs.co.uk (Rod Chapman)
Subject: Operator visibility question
Date: 3 Jun 2001 06:48:39 -0700
Date: 2001-06-03T13:48:39+00:00 [thread overview]
Message-ID: <ba18d5cb.0106030548.62aa45e2@posting.google.com> (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
next reply other threads:[~2001-06-03 13:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-03 13:48 Rod Chapman [this message]
2001-06-03 14:19 ` Operator visibility question 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox