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-Thread: 103376,673d883a7001e192 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Pure, Storage_Size and Unchecked_Conversion Date: Mon, 9 Jul 2007 20:35:11 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1183854255.792142.110150@i38g2000prf.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1184031172 16744 69.95.181.76 (10 Jul 2007 01:32:52 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 10 Jul 2007 01:32:52 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Xref: g2news1.google.com comp.lang.ada:16442 Date: 2007-07-09T20:35:11-05:00 List-Id: "Y.Tomino" wrote in message news:1183854255.792142.110150@i38g2000prf.googlegroups.com... ... > Ada.Unchecked_Conversion is pure generic function. > I think the condition of F1 and F2 is the same. > but, I saw this message: > > pure_ss_unc.ads:7:58: named access types not allowed in pure unit > > function F1 (X : Integer) return T; -- OK > function F2 is new Ada.Unchecked_Conversion (Integer, T); -- NG > > Why does compiler make an error at F2? You've gotten a whole bunch of answers, but I think the correct one has not be provided: it is a compiler bug and there should not be an error at F2. I'd suggest that you (and others as well) should ask the people at AdaCore about what appear to be compiler bugs (especially in things changed by the Amendment, which are highly likely to be buggy as they are new) rather than confusing many with examples that seem to show non-existent limitations of Ada (as opposed to a particular compiler). OTOH, if you don't have an AdaCore contract, you won't get a timely answer from them, but I'd have to say that you get what you pay for in that case... Randy.