CVS difference for ais/ai-00275.txt

Differences between 1.1 and version 1.2
Log of other versions for file ais/ai-00275.txt

--- ais/ai-00275.txt	2001/09/21 04:07:45	1.1
+++ ais/ai-00275.txt	2003/01/03 00:01:36	1.2
@@ -157,3 +157,68 @@
 is clearly a hole in the language.
 
 ****************************************************************
+
+From: Erhard Ploedereder
+Date: Sunday, October 10, 2002, 11:46 AM
+
+
+Ignore this, unless AI-275 or AI-295 are on your plate.
+
+Here are fixed-up versions of program examples in the two AIs, which
+I compiled at the meeting.
+
+Erhard
+-----------------------------
+
+
+procedure Test275 is
+
+   type Short_Int is range 1..10;
+
+   generic
+      type T is private;
+      type A is array (Short_Int) of T;
+      Obj : in T;
+   package Gen is
+      procedure S (Y : in out A);
+   end Gen;
+
+   package body Gen is
+      procedure S (Y : in out A) is
+      begin
+         Y(1) := Obj;
+      end S;
+   end Gen;
+
+   package P is
+      type T is private;
+      A : constant T;
+      type A1 is array (Short_Int) of aliased T;
+   private
+      type T (D : Integer := 0) is null record;
+      A : constant T := (D => 1);
+   end P;
+
+   X: P.A1;
+
+   package body P is
+      type Ptr is access all T;
+      subtype CPtr is Ptr(1);
+      Y: Ptr := X(1)'Access;
+      Z: CPtr := Y;
+   end P;
+
+   -- with P, Gen;
+   procedure Prob is
+      package Inst is new Gen (P.T, P.A1, P.A);
+   begin
+      Inst.S (X); -- This call will change the discriminant of X(1),
+      -- so we cannot allow the instantiation.
+   end Prob;
+begin
+   null;
+end Test275;
+
+[See !appendix of AI-00295 for Test295.]
+
+****************************************************************

Questions? Ask the ACAA Technical Agent