Version 1.1 of acs/ac-00045.txt

Unformatted version of acs/ac-00045.txt version 1.1
Other versions for file acs/ac-00045.txt

!standard 7.03(05)          02-08-28 AC95-00045/01
!class confirmation 02-07-30
!status received no action 02-07-30
!subject Reference to discriminant of incomplete private type
!summary
!appendix

!topic reference to discriminant of incomplete private type
!reference RM95-7.3(5)
!from Dan Eilers 02-07-30
!discussion

The restrictions on the use of a partial view of a private
type given in RM95-7.3(5) appear to be missing a rule
disallowing references to the discriminants of such a type.
There appears to be no good reason to allow references to
the discriminants, since there is no apparent way to initialize
such discriminants.

The following package doesn't appear to violate RM95-7.3(5),
but the reference to x.b is useless, since variable x can't be
initialized, except to null, so the reference to x.b can only
raise constraint_error.

   package pak is
      type T (b: boolean) is private;
      type access_t is access t;
      x: access_t := null;  -- can't initialize x except to null
      y: boolean := x.b;    -- useless reference to b since x is null
   private
      type T (b: boolean) is null record;
   end pak;

****************************************************************

From: Dan Eilers
Sent: Tuesday, July 30, 2002  8:02 PM

Nevermind!

I wrote:
> The restrictions on the use of a partial view of a private
> type given in RM95-7.3(5) appear to be missing a rule
> disallowing references to the discriminants of such a type.

This problem was fixed in AI95-00106.

****************************************************************

Questions? Ask the ACAA Technical Agent