comp.lang.ada
 help / color / mirror / Atom feed
From: Keean Schupke <keean.schupke@googlemail.com>
Subject: Re: Refactoring for error: cannot inline "X" (forward instance within enclosing body)
Date: Tue, 26 Jun 2012 00:51:59 -0700 (PDT)
Date: 2012-06-26T00:51:59-07:00	[thread overview]
Message-ID: <d651e7c9-e091-42a9-b56b-2502e6fab091@googlegroups.com> (raw)
In-Reply-To: <jsaf89$9a9$1@dont-email.me>

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.



  reply	other threads:[~2012-06-26  7:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 13:02 Refactoring for error: cannot inline "X" (forward instance within enclosing body) Keean Schupke
2012-06-25 13:03 ` Keean Schupke
2012-06-25 19:47 ` Brian Drummond
2012-06-26  7:51   ` Keean Schupke [this message]
2012-06-26  9:49     ` Georg Bauhaus
2012-06-26 11:53       ` Keean Schupke
2012-06-26 15:42         ` Keean Schupke
2012-06-26 20:06           ` Keean Schupke
2012-06-26 10:44     ` Brian Drummond
2012-06-26 22:43       ` Randy Brukardt
2012-06-27 10:04         ` Keean Schupke
2012-06-27 17:26       ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox