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=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,43aafc250d42730f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-07 14:57:16 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!wanadoo.fr!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: controlled type in generic package? Date: Wed, 7 Feb 2001 23:52:36 +0100 Organization: Wanadoo, l'internet avec France Telecom Message-ID: <95sjs9$ral$1@wanadoo.fr> References: <3A7FDA9A.C667090F@stn-atlas.de> <95p2ab$463$1@nnrp1.deja.com> <95q1fa$9e$1@usenet.rational.com> <95rpj5$gq7$1@nnrp1.deja.com> NNTP-Posting-Host: mix-tuileries-104-1-113.abo.wanadoo.fr X-Trace: wanadoo.fr 981586633 27989 193.250.183.113 (7 Feb 2001 22:57:13 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 7 Feb 2001 22:57:13 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: supernews.google.com comp.lang.ada:4957 Date: 2001-02-07T22:57:13+00:00 List-Id: "Ted Dennison" a �crit dans le message news: 95rpj5$gq7$1@nnrp1.deja.com... > I have to admit I'm a little unclear as to what nasty things could > happen to me if I were allowed to declare a derived tagged type at a > lower scope level than their parent type. OK, let's go: package body Pack is type Parent is tagged ...; procedure Proc (X : Parent) is ... end Proc; type Ptr is access Parent'Class; V : Ptr; procedure P is type Child is new Parent with...; procedure Proc (X : Child) is... end Proc; begin V := new Child; end P; begin P; -- Now, V.all points to an object of type P.Child -- We can call Proc (V.all) which will result in a dispatching call to P.Proc, but P is out of scope at this point !!!