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!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: "too few element" in an unconstrained array, given as litteral ? Date: Sat, 20 Jan 2018 14:28:06 +0200 Organization: Tidorum Ltd Message-ID: References: <25736b03-e178-41ce-84fc-0e7da0e11420@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net /vbwA1+vj4X26P/8qfheKwrVz78y0Fzr6HHMKy430/3E4efmix Cancel-Lock: sha1:yfZems2L1VKeh6IkCkj9ufQzMPo= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <25736b03-e178-41ce-84fc-0e7da0e11420@googlegroups.com> Xref: reader02.eternal-september.org comp.lang.ada:50020 Date: 2018-01-20T14:28:06+02:00 List-Id: On 18-01-20 12:55 , Mehdi Saada wrote: > The definitions for polynoms I slightly modified, don't fit anymore wit the test program: > > 28 Set(Poly3,(2/1, 5/8)); -- but every call on Set does the same > ts_poly1.adb:28:14: warning: too few elements for type "T_Liste_Coef" defined > at p_poly_v1_g.ads:48, instance at line 20 > ts_poly1.adb:28:14: warning: "Constraint_Error" will be raised at run time ... > The current definitions: > type T_Liste_Coef is array (T_Degre range 1..T_Degre'Last) of T_Rationnel; ... > How can an object of an UNCONSTAINED array type, given as a litteral, have > "too few elements ?" T_Liste_Coef is not unconstrained; there is no "range <>" in its declaration. It is constrained and any object of this subtype needs T_Degre'Last elements. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .