comp.lang.ada
 help / color / mirror / Atom feed
* Does 3.9.3(10) apply to untagged private whose full view is tagged?
@ 2007-07-25 22:04 Adam Beneschan
  2007-07-26  5:08 ` AW: " Grein, Christoph (Fa. ESG)
  2007-07-26  8:58 ` anon
  0 siblings, 2 replies; 5+ messages in thread
From: Adam Beneschan @ 2007-07-25 22:04 UTC (permalink / raw)


I think the following is legal, but the version of GNAT I'm using
rejects it, citing 3.9.3(10):

package Pak1 is
   type T1 is private;
private
   type T1 is tagged record
      F1 : Integer;
  end record;
  function Func (X : Integer) return T2;
end Pak1;

3.9.3(10) says, in part, "For a tagged type declared in a visible
part, a primitive function with a controlling result shall not be
declared in the private part, unless it is overriding a function
implicitly declared in the visible part."  My interpretation, though,
is that it doesn't apply here, and that it only applies to types that
are *visibly* tagged in the visible part---not to untagged private
types whose full view is tagged.  The AARM reasoning for the rule has
to do with other packages that declare type extensions of the type
that wouldn't know that there's a private function that needs to be
overridden---but in this case, other packages (except for private
children, which have access to the entire private part of Pak1) can't
declare a type extension of T1; so it would make sense that the rule
wouldn't apply to this code.  Anyway, that's my interpretation, but it
seems within the realm of possibility to interpret it the other way.

So who's right?  Me or GNAT?

                           -- Adam




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

end of thread, other threads:[~2007-07-26 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-25 22:04 Does 3.9.3(10) apply to untagged private whose full view is tagged? Adam Beneschan
2007-07-26  5:08 ` AW: " Grein, Christoph (Fa. ESG)
2007-07-26  8:58 ` anon
2007-07-26 10:40   ` Georg Bauhaus
2007-07-26 15:07     ` Adam Beneschan

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