Version 1.3 of si99s/si99-0044-1.txt

Unformatted version of si99s/si99-0044-1.txt version 1.3
Other versions for file si99s/si99-0044-1.txt

!standard 16.6          09-03-03 SI99-0044-1/02
!class Binding Interpretation 08-10-21
!status ARG Approved 9-0-1 09-02-20
!status work item 08-10-21
!status received 08-10-21
!priority Low
!difficulty Easy
!qualifier Omission
!subject Parent subtype without a declaration
If the ancestor type in a derived type declaration has no explicit declaration, the value returned by Corresponding_Parent_Subtype is implementation defined.
Corresponding_Parent_Subtype (16.6) is defined as returning an Asis.Declaration. What is returned by the following declaration?
type T is new Integer'Base;
There is no declaration for Integer'Base!
(See summary.)
Move 16.6 to F.6.3 (moving it to the obsolescent features section):
Add at the very beginning: This function has been replaced by Parent_Subtype_Indication. Use of the function Corresponding_Parent_Subtype is not recommended in new programs.
After "The parent subtype is defined by the parent_subtype_indication." add:
If the parent subtype has no explicit declaration, the value returned is implementation defined.
Note that we have a similar problem if the subtype_indication is anonymous:
type T is new Integer range 1..10;
So this routine often cannot return a meaningful answer.
In addition, Corresponding_Parent_Subtype is rather redundant, as Parent_Subtype_Indication gives the appropriate information without losing anything. This routine seems pretty much useless (it is the combination of two other ASIS routines), and it doesn't return anything useful in many cases. So it should be obsolescent.
But even so, we need to say something about what it does. We say it is implementation-defined (we don't want to make implementers any work to make it work in a particular way - it exists only for compatibility with old programs, and for that, whatever it was doing in the old implementation is best).


Questions? Ask the ACAA Technical Agent