From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Aggregate with derived types. Date: Thu, 14 Sep 2023 17:31:47 +0200 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 14 Sep 2023 15:31:48 -0000 (UTC) Injection-Info: dont-email.me; posting-host="07e56f92c66353d191d247ff13a33972"; logging-data="2779762"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WyH4zd2Xt9fnZkYL4pRwHO6vJWyvgFBQ=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Cancel-Lock: sha1:YXLMLYsn9gvo2OjRwD8D9yd6ciU= In-Reply-To: Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:65651 List-Id: On 2023-09-14 16:02, Blady wrote: > >      1. with Ada.Containers.Vectors; >      2. with Ada.Text_IO; >      3. procedure test_20230914_derived_agg is >      4.    package My_Float_Lists is new Ada.Containers.Vectors (Positive, Float); >      5.    subtype My_Float_List1 is My_Float_Lists.Vector; >      6.    type My_Float_List2 is new My_Float_Lists.Vector with null record; >      7.    ML1 : My_Float_List1 := [-3.1, -6.7, 3.3, -3.14, 0.0]; >      8.    ML2 : My_Float_List2 := ([-3.1, -6.7, 3.3, -3.14, 0.0] with null > record); >                                     | >         >>> error: no unique type for this aggregate IIUC, you have to qualify the value: (My_Float_List1'[-3.1, -6.7, 3.3, -3.14, 0.0] with null record) or (My_Float_Lists.Vector'[-3.1, -6.7, 3.3, -3.14, 0.0] with null record) (not tested) -- Jeff Carter "[M]any were collected near them, ... to enjoy the sight of a dead young lady, nay, two dead young ladies, for it proved twice as fine as the first report." Persuasion 155