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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: limited agregate and limited components default initialization Date: Mon, 2 Apr 2018 16:37:57 -0500 Organization: JSA Research & Innovation Message-ID: References: <29943b13-00d1-443a-82f2-f55272770109@googlegroups.com> <12766e64-7641-45a0-8e76-8330a3b3c101@googlegroups.com> Injection-Date: Mon, 2 Apr 2018 21:37:58 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="2170"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:51307 Date: 2018-04-02T16:37:57-05:00 List-Id: Yes, I believe these two should work the same. (I'm not trying to figure out which is wrong.) I suggest a bug report... - Randy. "Jean-Claude Rostaing" <00120260a@gmail.com> wrote in message news:d83d9dd1-3674-4299-ac9c-1bf5862ae0e2@googlegroups.com... > It works, so much for "impossible" dmitry. > > I probably read before the implementation you mentioned, I don't remember > exactly. I saw something strange writing this. Shouldn't the expression > function > function GET (Pointer : Pointer_Type) return Accessor_Type is > (if Pointer.Pointer = null or else POINTER.Pointer.Value = null then > raise EXC_NULL_POINTER_ACCESS > else ACCESSOR_TYPE'(Data_Link => Pointer.Pointer.Value)); > be strictly equivalent to > function GET (Pointer : Pointer_Type) return Accessor_Type is > begin > if Pointer.Pointer = null or else POINTER.Pointer.Value = null then > raise EXC_NULL_POINTER_ACCESS; > else > return ACCESSOR_TYPE'(Data_Link => Pointer.Pointer.Value); > end if; > end GET; > ? Yet no, the second is fine, the second raises at run time > raised CONSTRAINT_ERROR : pointers.adb:20 discriminant check failed