From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!uunet!husc6!mit-eddie!bbn!inmet!ishmael!inmet!authorplaceholder From: stt@inmet.UUCP Newsgroups: comp.lang.ada Subject: Derived private type in Ada 9X Message-ID: <124000011@inmet> Date: 4 Mar 88 15:45:00 GMT Nf-ID: #N:inmet:124000011:000:1191 Nf-From: inmet.UUCP!stt Mar 4 10:45:00 1988 List-Id: Here's another gripe for the Ada 9X effort: It is quite annoying that private types with discriminants may not be defined as derived types, where the parent type has matching or conforming discriminants. For example, the following is currently illegal, due to 7.4.1:3 -- "If a private type declaration includes a discriminant part, the full declaration must include a discriminant part that conforms . . . and its type definition must be a record type definition." package Public_Pkg is type Public_Rec(D : Boolean := True) is record case D is when True => X : Integer; when False => Y : Float; end case; end record; end Public_Pkg; with Public_Pkg; package Private_Pkg is type Private_Rec(D : Boolean := True) is private; private type Private_Rec is new Public_Pkg.Public_Rec; end Private_Pkg; Here is some alternate wording which would allow this situation: "If a private type includes a discriminant, the full declaration must include a discriminant part..., or must be a derived type definition where the parent type is a type with discriminants whose definition conforms." Tucker Taft c/o Intermetrics Cambridge, MA 02138