comp.lang.ada
 help / color / mirror / Atom feed
From: Bill Keen <billy@marnhull.demon.co.uk>
Subject: Re: Elaboration of nested packages.
Date: 1997/06/22
Date: 1997-06-22T00:00:00+00:00	[thread overview]
Message-ID: <gJzYpGAPvGrzEwpv@marnhull.demon.co.uk> (raw)
In-Reply-To: dewar.866853665@merv


In article <dewar.866853665@merv>, Robert Dewar <dewar@merv.cs.nyu.edu>
writes
>This is invalid code, since the instantiation appears before the body of
>the generic. It should raise Program_Error, 

Thanks, both repsonses have confirmed my understanding. It is just that
the two compilers at work both let this through, Alsys 4.2 and Green
Hills 1.8.7 (I think) and when I brought it home and run it through GNAT
I started to doubt my grasp of the issue. It seems that many compilers
are lax in this area.

The odd thing is, if you declare the generic at the outer level the
Alsys compiler spots the problem right away. 
  ...
  generic
  package IG is
  end IG;
  package PI is new OP.IG; -- Is this ok?
  package body IG is
  begin
  end;
  ...
Hide it in one layer of package and it can't see the problem.

-- 
Bill Keen




  reply	other threads:[~1997-06-22  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
1997-06-22  0:00   ` Bill Keen [this message]
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