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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7508aa0d80b8bf66 X-Google-Attributes: gid103376,public From: lutz@iks-jena.de (Lutz Donnerhacke) Subject: Re: Inheritance and Polymorphism in Ada !! Date: 1999/10/15 Message-ID: #1/1 X-Deja-AN: 536989668 Distribution: world Content-Transfer-Encoding: 8bit References: <7u64k3$l1d$1@hiline.shinbiro.com> <3806DC34.1513E8B1@frqnet.de> Content-Type: text/plain; charset=ISO-8859-1 Organization: IKS GmbH Jena Mime-Version: 1.0 User-Agent: slrn/0.9.5.7 (UNIX) Newsgroups: comp.lang.ada Date: 1999-10-15T00:00:00+00:00 List-Id: * Andreas Winckler wrote: >14 begin >15 pointer := new type_b; >16 type_b(pointer.all).second_field := 1; >17 end inheritance_polymorphism; > >See line 16, the type of the referenced object must be known in advance. >With "pointer.second_field :=1" the compiler fails. It seems that the >strong typing restricts the features of polyormism in Ada. Any comments? >Am I wrong? Yep. To access data, please provide functions. They dispach as required for polymorphism.