CVS difference for ai05s/ai05-0115-1.txt

Differences between 1.13 and version 1.14
Log of other versions for file ai05s/ai05-0115-1.txt

--- ai05s/ai05-0115-1.txt	2011/04/22 03:01:40	1.13
+++ ai05s/ai05-0115-1.txt	2011/04/22 03:08:51	1.14
@@ -1,4 +1,4 @@
-!standard 4.3.2(5/2)                                  11-04-19  AI05-0115-1/08
+!standard 4.3.2(5/2)                                  11-04-19  AI05-0115-1/09
 !standard 7.3.1(5/1)
 !class binding interpretation 08-10-15
 !status work item 08-10-15
@@ -157,17 +157,19 @@
         type T is private;
      private
         type T is new Integer;
+        C : constant T := 42;
      end P;
 
      with P;
      package Q is
-         type T2 is new T;
+         type T2 is new P.T;
      end Q;
 
+     with Q;
      package P.Child is
-         type T3 is new T2;
+         type T3 is new Q.T2;
      private
-         X : T3 := T3(42);  -- legal: conversion allowed
+         X : T3 := T3(P.C);  -- legal: conversion allowed
          Y : T3 := X + 1;   -- error: no visible "+" operator
      end P.Child;
 
@@ -206,7 +208,7 @@
 a given view of a type is a descendant.  The basic principle is that you
 inherit characteristics from an ancestor only through your immediate parent
 type, and you can never end up with "more" characteristics than that of your
-parent type.  However, we have preserved the ability to convert to any visible
+parent type. However, we have preserved the ability to convert to any visible
 ancestor, even if the parent is unaware of the ancestor.
 
 The reference manual was scanned to see whether to extend the notion of
@@ -2661,5 +2663,148 @@
 the right to convert to any ancestor you know about.
 
 [This is version /08 of the AI - Editor.]
+
+****************************************************************
+
+From: Ed Schonberg
+Sent: Tuesday, April 19, 2011  4:19 PM
+
+The final AARM example needs assorted use clauses or expanded names to be legal:
+
+package P is
+        type T is private;
+     private
+        type T is new Integer;
+     end P;
+
+     with P;
+     package Q is
+         type T2 is new T;  <==  P.T
+     end Q;
+      <==  with Q;
+     package P.Child is
+         type T3 is new T2;   <=== Q.T2
+     private
+         X : T3 := T3(42);  -- legal: conversion allowed
+         Y : T3 := X + 1;   -- error: no visible "+" operator
+     end P.Child;
+
+However, this is a change to the previous version of the AI.  I don't think that
+conversion was legal in the most recent version.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Tuesday, April 19, 2011  5:38 PM
+
+> The final AARM example needs assorted use clauses or expanded names to be
+> legal:
+
+Oops, sorry about that.  I'll make the fixes.
+
+...
+> However, this is a change to the previous version of the AI.
+> I don't think that conversion was legal in the most recent version.
+
+Right.  That is why I called this a "significant" update.
+It incorporates the decision to be "generous" with conversions, while being
+"stingy" with inheriting other characteristics.
+
+****************************************************************
+
+From: Ed Schonberg
+Sent: Tuesday, April 19, 2011  6:07 PM
+
+This is a rather curious twist in this AI.  The original intent was to narrow
+visibility and prevent inference of properties from ancestors that may be partly
+hidden. Now this change goes in the opposite direction, and as far as I can tell
+is incompatible with all previous versions of the language. Is this really
+necessary?
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Tuesday, April 19, 2011  6:41 PM
+
+It can't be incompatible (I hope), since it is at most allowing something that
+previously was (arguably) not allowed. OTOH, Tucker's previous rule appeared to
+me to be incompatible, as it was making illegal conversions that previously were
+(again, arguably) allowed.
+
+The problem is that the old rules about the descendant relationship did not
+clearly take visibility into account, and as such it is not at all clear to me
+what the old rules were in examples like this. Based on that, I think it is
+safer to allow a bit more than used to be allowed than to allow *less* and break
+existing code for no reason at all. And I thought that is what we decided during
+the most recent phone call.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Tuesday, April 19, 2011  7:19 PM
+
+We definitely talked about this on our recent phone call.  Here is a selection
+from the minutes:
+
+  AI05-0115-1/07 Aggregates with components that are not visible
+
+   Tucker notes that we don't want to inherit
+   characteristics from a parent. But it is
+   not a clear that this is a good thing for
+   type conversion. Steve asks if there would
+   be cases where you can convert A to B and
+   B to C, but not A to C.
+
+   Tucker will try to come up with wording that
+   has that effect.
+
+   Approve intent: 6-0-2.
+
+  Summary:
+     AI05-0115-1 Redo wording to allow conversions
+     (explicit or implicit) so long as enough information
+     is visible, characteristics are based on the parent's view.
+
+I am trying to preserve compatibility.
+Unfortunately, the rules in this area
+are not explicitly spelled out anywhere.
+My earlier proposal seemed to go too far in one direction.  I can believe this
+one is going to far in the other direction.
+
+I am happy to have suggestions for wording which we believe corresponds to the
+"current" rules.
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Tuesday, April 19, 2011  8:32 PM
+
+OK, Here is a version with a slightly different example. [This is version
+/09 of the AI - Editor.]
+I think the first example was wrong, because it was depending on the type T3
+being considered a numeric type, since it was really converting from univ-int to
+T3. And that is a characteristic which is *not* inherited by T3.  In the new
+example, it is converting from an object of type P.T, which should be allowed.
+
+-------
+      package P is
+         type T is private;
+      private
+         type T is new Integer;
+         C : constant T := 42;
+      end P;
+
+      with P;
+      package Q is
+          type T2 is new P.T;
+      end Q;
+
+      with Q;
+      package P.Child is
+          type T3 is new Q.T2;
+      private
+          X : T3 := T3(P.C);  -- legal: conversion allowed
+          Y : T3 := X + 1;   -- error: no visible "+" operator
+      end P.Child;
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent