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 X-Received: by 2002:ac8:108:: with SMTP id e8mr16656997qtg.101.1579791742299; Thu, 23 Jan 2020 07:02:22 -0800 (PST) X-Received: by 2002:a05:6830:194:: with SMTP id q20mr12138978ota.92.1579791741845; Thu, 23 Jan 2020 07:02:21 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!g89no2918246qtd.0!news-out.google.com!o19ni684qtr.1!nntp.google.com!g89no2918240qtd.0!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 23 Jan 2020 07:02:21 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=136.163.208.2; posting-account=HFCrOQoAAABZD_f-UUbYHm3lJDIrh-UX NNTP-Posting-Host: 136.163.208.2 References: <6dbb0da9-8c68-435e-945d-d0e1eefeda4c@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Calling a record type's methods (functions or procedure) when record is in an array From: joakimds@kth.se Injection-Date: Thu, 23 Jan 2020 15:02:22 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:57926 Date: 2020-01-23T07:02:21-08:00 List-Id: Obvious copy paste error: function Allocate_Car return Any_Car is Default : constant Any_Car := (Offset => Taft_Car'Max_Size_In_Storage_Elements, Allocated_Memory => (others => 0), Reference => null); begin return Car : Any_Car (Taft_Car'Max_Size_In_Storage_Elements) do declare First_Index : constant System.Storage_Elements.Storage_Offset := Car.Allocated_Memory'First; begin Car.Reference := Conversions.To_Pointer (Car.Allocated_Memory (First_Index)'Address).all'Access; end; end return; end Allocate_Car; should be: function Allocate_Car return Any_Car is begin return Car : Any_Car (Taft_Car'Max_Size_In_Storage_Elements) do declare First_Index : constant System.Storage_Elements.Storage_Offset := Car.Allocated_Memory'First; begin Car.Reference := Conversions.To_Pointer (Car.Allocated_Memory (First_Index)'Address).all'Access; end; end return; end Allocate_Car; Other issues? Best regards, Joakim