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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cf56949c9ced83a9,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news2.telebyte.nl!news-fra1.dfn.de!newsfeed.hanau.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: "Rick Santa-Cruz" Newsgroups: comp.lang.ada Subject: implicit cast and inheritance Date: Fri, 1 Oct 2004 22:50:02 +0200 Organization: T-Online Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1096663821 03 19644 4eXPX2lvAEHf3VP 041001 20:50:21 X-Complaints-To: usenet-abuse@t-online.de X-ID: ZeXkf6ZvQeSckuMYRSkionHtgJKUaFT3r7SQvqXZrtJAGMrHQqDfrM X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:4534 Date: 2004-10-01T22:50:02+02:00 List-Id: Hi, I have a small question. See the following source-code: package Pack is type Base is tagged record Value: Integer; end record; procedure Base_Proc(B: Base); type Derived is new Base with null record; end Pack; And now I have the following source for the main-procedure: with Pack; use Pack; procedure main is B: Base; D: Derived; procedure Proc(B: Base) is begin null; end Proc; begin Pack.Base_Proc(B); -- 1 Pack.Base_Proc(D); -- 2 Proc(B); -- 3 Proc(D); -- 4 end main; It is clear to me, that the (4) won't compile, but I can solve it in making a cast or defining Proc with 'Class. My question is now why I can call Base_Proc(D). It is clear to me that the class Derived inherit the Base_Proc-Procedure from its base-class, but what is with the parameter? Why does this work? I have a suggestion why this works... cause it is in the same package... but how does it internly work? If it is in the same package, is then always implicitly done a cast, or is the procedure Base_Proc in the derived class "Derived" automatically defined with a parameter Type "Derived"? Thanks a lot in advance, Rick