comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Elaboration of nested packages.
Date: 1997/06/20
Date: 1997-06-20T00:00:00+00:00	[thread overview]
Message-ID: <dewar.866853665@merv> (raw)
In-Reply-To: yrQ8RCAF8EqzEwgc@marnhull.demon.co.uk


Bill Keen asks about

<<with Ada.text_io; use Ada.text_io;
procedure P is
  package OP is
    generic
    package IG is
    end IG;
  end OP;
  package PI is new OP.IG; -- Is this ok?
  package body OP is
    package body IG is
    begin
      put_line("Elaborated body IG");
    end;
  begin
    put_line("Elaborated body OP");
  end;
begin
  put_line("Main program");
end P;>>


This is invalid code, since the instantiation appears before the body of
the generic. It should raise Program_Error, but this check is not in GNAT
3.07.

The current version of GNAT (3.10) will generate a static warning that this
instantiation will raise Program_Error, and then if you execute the program,
it *will* raise program_error.





  parent reply	other threads:[~1997-06-20  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-18  0:00 Elaboration of nested packages Bill Keen
1997-06-19  0:00 ` Robert A Duff
1997-06-20  0:00 ` Robert Dewar [this message]
1997-06-22  0:00   ` Bill Keen
1997-06-22  0:00     ` Robert Dewar
replies disabled

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