CVS difference for ais/ai-00262.txt

Differences between 1.22 and version 1.23
Log of other versions for file ais/ai-00262.txt

--- ais/ai-00262.txt	2005/08/05 04:33:47	1.22
+++ ais/ai-00262.txt	2005/10/31 05:18:20	1.23
@@ -3741,4 +3741,70 @@
 
 ****************************************************************
 
+!topic "private with" and generic formal parameters
+!reference RM05-10.1.2
+!from Duncan Sands 05-05-20
+!discussion
+
+Is the following construction intended to be legal?
+
+-- G --
+generic
+   with procedure E;
+package G is
+   pragma Elaborate_Body; -- E not used in public part
+end;
+
+package body G is
+... -- E used in body
+end;
+
+-- P --
+package P is
+...
+end;
+
+-- P.E --
+private procedure P.E;
+procedure P.E is
+...
+end;
+
+-- P.C --
+with G;
+private with P.E;
+package P.C is new G (P.E); -- is this declaration legal?
+
+****************************************************************
+
+From: Gary Dismukes
+Sent: Friday, May 20, 2005  3:47 PM
+
+> with G;
+> private with P.E;
+> package P.C is new G (P.E); -- is this declaration legal?
+
+No, the instantiation is illegal because the name of a privately
+withed unit isn't allowed in that context (basically it's only
+allowed within private parts and bodies).  It would be unlikely
+to be a simple change to allow this since special rules would
+be required to prevent incorrect uses, plus the visibility rules
+don't come into play in the implicit specification of a generic
+instantiation.
+
+****************************************************************
+
+From: Duncan Sands
+Sent: Thursday, June  2, 2005  10:25 AM
+
+I agree that it looks like more trouble than it is worth.  This
+came up when I wanted to pass a lock into the body of a generic
+package, without the lock being publicly visible.  It was easy
+enough to get the same effect by putting a wrapper around the
+generic.  So personally I have no use for this construction, but
+I thought I should bring it up since I saw no discussion in the
+AI.
+
+****************************************************************
+
 

Questions? Ask the ACAA Technical Agent