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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7149ea26d9d2075c,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-05 03:43:52 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news.xtra.co.nz!news.mel.connect.com.au!not-for-mail From: "Matthew Baulch" Newsgroups: comp.lang.ada Subject: Upcasting Date: Tue, 05 Nov 2002 22:43:32 +1100 Organization: Customer of Connect.com.au Pty. Ltd. Message-ID: NNTP-Posting-Host: 210.11.36.53 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: perki.connect.com.au 1036496631 13211 210.11.36.53 (5 Nov 2002 11:43:51 GMT) X-Complaints-To: abuse@connect.com.au NNTP-Posting-Date: 5 Nov 2002 11:43:51 GMT User-Agent: Pan/0.13.0 (The whole remains beautiful) Xref: archiver1.google.com comp.lang.ada:30379 Date: 2002-11-05T11:43:51+00:00 List-Id: For the records: ... type Base is tagged with record Base1, Base2 : Integer; end record; type Derived is new Base with record Derived1, Derived2 : Float; end record; ... Foo1 : Base; Foo2 : Derived; ... Obviously to assign Foo2 to Foo1 you would: Foo1 := Base(Foo2); But if you wanted to assign Foo1 to Foo2: Foo2 := (Foo1 with 5.0, 10.0); would work. My question is: How would you do this 'upcasting' if varying types existed? Obviously the compiler could tell where each value must go based on their type if only one of their type was needed in the transition. How does this type of thing work? (or does the A95 compiler not allow it)