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!news.eternal-september.org!mx02.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: Incompatible types for array conversion Date: Wed, 22 Jul 2015 10:41:20 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net +bOA5citNObu551h8DUkyABEuzLBs/a5jkvDqctKfdtGC/8qYp Cancel-Lock: sha1:8HGETIgGG+wevfuXUyvJDfMktn0= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:26964 Date: 2015-07-22T10:41:20+03:00 List-Id: On 15-07-22 10:13 , Simon Wright wrote: > Niklas Holsti writes: > >> The conversion is rejected because of the conversion condition in RM >> 4.6 (24.5/2): "The component subtypes shall statically match". The >> component (sub)types are Real and Length, which are different types, >> although Length is derived from Real. If you change the declaration of >> Length to be >> >> subtype Length is Real; >> >> the conversion becomes legal. > > I tried > > generic > dim: positive; > type Real is digits <>; > package Vectors is > type Vector is array (1..dim) of Real'Base; > > but it still failed. (GPL 2015, FSF 5.1.0) Did you expect it to work? Real'Base gets rid of any constraints on Real, but AIUI does not get rid of the type derivation; if "type Length is new Real", Length'Base is not the same as Real'Base -- the "new" makes them different. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .