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,d80cdc1b3ff5b2f9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-14 15:08:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!diablo.theplanet.net!news.theplanet.net!not-for-mail From: "Stephen Cole" Newsgroups: comp.lang.ada Subject: Re: Simple Question 3 Date: Sun, 14 Oct 2001 23:08:51 +0100 Message-ID: <9qd2c9$4a2$1@news7.svr.pol.co.uk> References: <9q49v5$6dj$1@trog.dera.gov.uk> <9qcmt9$8n1$1@newsg1.svr.pol.co.uk> <3BC9FD23.ACEB872A@acm.org> NNTP-Posting-Host: modem-1809.lion.dialup.pol.co.uk X-Trace: news7.svr.pol.co.uk 1003097289 4418 217.135.167.17 (14 Oct 2001 22:08:09 GMT) NNTP-Posting-Date: 14 Oct 2001 22:08:09 GMT X-Complaints-To: abuse@theplanet.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Xref: archiver1.google.com comp.lang.ada:14491 Date: 2001-10-14T22:08:09+00:00 List-Id: "Jeffrey Carter" wrote in message news:3BC9FD23.ACEB872A@acm.org... > > We could perhaps be of more assistance if you could define what you > expect the compiler to do for > > X : Mytesttype2 := Unitc; > > What is the value of X after initialization? Specifically, what is the > value of X.C? > > -- > Jeff Carter > "I fart in your general direction." > Monty Python & the Holy Grail I would have thought that the compiler would have looked for a function called UnitC() that would return a type MyTesttype2. If it could not find one then it would flag a static match failure and so the whole problem of X.C being initialised would not have occured as it would not be allowed. HOWEVER if it had been... X: MyTestType1'class := UnitC I would have expected it to have accepted it as there is only one UnitC() function in existence (in my Ada world). If there were two then it would be refused as ambiguouse. But this not the case as Ada will not accept the derivation of a new type without also requiring that all base type functions that return a base type value, be redeclared in terms of the new type. Which may be proper but I don't see why?! Sorry. Maybe I'm just being thick. I'll try an read the ARM95 manual. There must be a good reason as I have not come across anything yet in Ada which does not have a good reason.