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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.107.161.143 with SMTP id k137mr662766ioe.130.1518523402036; Tue, 13 Feb 2018 04:03:22 -0800 (PST) X-Received: by 10.157.112.141 with SMTP id l13mr33051otj.1.1518523401876; Tue, 13 Feb 2018 04:03:21 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!w142no1331594ita.0!news-out.google.com!m16ni3329itm.0!nntp.google.com!w142no1331592ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 13 Feb 2018 04:03:21 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.154.189.221; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 82.154.189.221 References: <634e9064-33f8-42c0-9032-e630f98c89d4@googlegroups.com> <5f36f0ae-87ed-4482-9766-561b63b1d343@googlegroups.com> <58302fb3-4b2d-4651-82ca-1efa0b2de8f3@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3a5bb7ad-c07d-4fab-960a-6c605b9a7c6f@googlegroups.com> Subject: Re: troubles learning OOP: expected type "Parent.Some_Child", found type Parent'Class From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Tue, 13 Feb 2018 12:03:22 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 120886996 X-Received-Bytes: 2502 Xref: reader02.eternal-september.org comp.lang.ada:50417 Date: 2018-02-13T04:03:21-08:00 List-Id: I understand, but I can't change the structure that much. I would have to rewrite x packages. Better stick with my solution... It seems sound. For the aliased thing, I forgot and did that: EMPILER (PILE, new T_Token_Operateur'(To_Token (TAMPON_PRIORITE.L_Operateur))); Access to constant means access to a value that is constant, not only to things declared on the stack like A: constant INTEGER := 5. I can still use the heap. I nearly forgot that. Though it's less consistent that I would have liked. At last it COMPILES without fault. One last warning: PILE_PRIORITE : P_PILE_2.T_Pile(50); is initiliazed, and the component that is refered to before calling on "PUSH", HEIGTH has a default value: T_ELEME is private; type T_Pile (Le_Max : T_Max) is limited private; private type T_Pile (Le_Max : T_Max) is record HEIGTH : T_Max := 0; -- en fait entre 0..LE_MAX V : T_Vect (1..Le_Max); end record; Can't it see that HEIGTH will never be read uninitialized ? for I in 1 .. Hauteur (PILE_PRIORITE) loop