From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Problem with controlled types
Date: 1998/12/14
Date: 1998-12-14T00:00:00+00:00 [thread overview]
Message-ID: <m367beshjr.fsf@mheaney.ni.net> (raw)
In-Reply-To: 753cnv$3sq$1@nnrp1.dejanews.com
bourguet@my-dejanews.com writes:
> with ada.finalization;
>
> package Pkg is
>
> type A is private;
> -- operations on B
>
> type B is private;
>
> function Get_B (I: A) return B;
> -- other operations on B
>
> private
>
> type A is new Ada.Finalization.Controlled with record
> ...
> end record;
>
> type B is new Ada.Finalization.Controlled with record
> ...
> end record;
>
> end pkg;
>
> ObjectAda complain that the Get_B function is primitive on two tagged
> types, and that is not allowed.
>
> Gnat compile and run correctly (as A'Class contains only A and
> B'Class only B, this is not strange).
>
> Now, which one is correct?
GNAT is correct; ObjectAda is incorrect.
An operation cannot be primitive for more that one type is only true for
(publicly) tagged types. Since A and B and not publically tagged,
Get_B is a legal operation.
next prev parent reply other threads:[~1998-12-14 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-14 0:00 Problem with controlled types bourguet
1998-12-14 0:00 ` Matthew Heaney [this message]
1998-12-14 0:00 ` Tom Moran
1998-12-14 0:00 ` Tucker Taft
1998-12-14 0:00 ` Robert I. Eachus
1998-12-14 0:00 ` 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