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!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!elma.epfl.ch!madmats From: madmats@elma.epfl.ch (Mats Weber) Newsgroups: comp.lang.ada Subject: Limited types and generic parameters Message-ID: <890222132712.21a009c0@elcc.epfl.ch> Date: 22 Feb 89 12:27:12 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Question on limited types and generic parameters. Consider the following piece of Ada code: generic type T is limited private; package GP is type R is record F : T; end record; end GP; package P is new GP(T => INTEGER); X : P.R := (F => 45); -- * Y : P.R := (F => 77); -- * ... X.F := 56; X := Y; -- * Are the *-marked assignments correct ? In other words, is P.R a limited type ? LRM 7.4.4(2) says: "... a composite type is limited if the type of any of its subcomponents is limited." In this case, there are two possible interpretations: - The declaration of type P.R occurs in the context of the generic package GP. - The declaration of type P.R occurs in the context of the instance P. According to LRM 12.3(9) "For a name that denotes a generic formal type: The corresponding name denotes the subtype named by the associated generic actual parameter (the actual subtype)." The second interpretation seems to be the right one, which would make the type P.R non limited. What do you think ? (I would like J. Goodenough to see this). Mats Weber Swiss Federal Institute of Technology EPFL DI LITh 1015 Lausanne Switzerland e-mail : madmats@elma.epfl.ch