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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d65138770e3daae3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.238.65 with SMTP id vi1mr15981131pbc.7.1340697119520; Tue, 26 Jun 2012 00:51:59 -0700 (PDT) Path: l9ni21210pbj.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Keean Schupke Newsgroups: comp.lang.ada Subject: Re: Refactoring for error: cannot inline "X" (forward instance within enclosing body) Date: Tue, 26 Jun 2012 00:51:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <7a18bc7e-2541-46f9-9d92-65d87fed06e6@googlegroups.com> NNTP-Posting-Host: 82.44.19.199 Mime-Version: 1.0 X-Trace: posting.google.com 1340697119 21255 127.0.0.1 (26 Jun 2012 07:51:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 26 Jun 2012 07:51:59 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.44.19.199; posting-account=T5Z2vAoAAAB8ExE3yV3f56dVATtEMNcM User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-06-26T00:51:59-07:00 List-Id: On Monday, 25 June 2012 20:47:21 UTC+1, Brian Drummond wrote: > On Mon, 25 Jun 2012 06:02:21 -0700, Keean Schupke wrote: > > > Hi, > > > > > > I am forcing the inlining of some procedures using: > > > > pragma Inline_Always(X); > > > > and I am getting the error: > > > > cannot inline "X" (forward instance within enclosing body) > > > > Can someone explain what a forward instance is and what the enclosing > > body (IE the scope of the error is). > > Try posting a minimal compilable example that allows others to reproduce > the problem. > > - Brian Here's the minimal test example (as minimal as I can make it so far...): procedure Test is generic type A is private; with function F(Node : in A) return A is <>; package Test_Signature is end; generic package Test_Implementation is type A is record null; end record; function F(X : in A) return A; pragma Inline_Always(F); end Test_Implementation; package body Test_Implementation is function F( X : in A ) return A is begin return X; end F; end Test_Implementation; package Test_Use is package T is new Test_Implementation; use T; package U is new Test_Signature(A => T.A); end Test_Use; begin null; end Test; Cheers, Keean.