CVS difference for ais/ai-00216.txt

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

--- ais/ai-00216.txt	2005/10/31 05:18:10	1.21
+++ ais/ai-00216.txt	2005/12/20 02:33:58	1.22
@@ -3244,3 +3244,43 @@
 
 *************************************************************
 
+From: Tucker Taft
+Sent: Tuesday, November 29, 2004 at  3:41 PM
+
+I happened to be working on our implementation of unchecked-union,
+and I couldn't understand the rationale behind the rules relating
+to the stream attributes (B.3.3(27/2,28/2)).
+
+They say:
+
+   Program Error is raised in the following cases:
+
+      * Execution of the default implementation of the Write or Read
+        attribute of an unchecked union type
+
+      * Execution of the default implementation of the Output or Input
+        attribute of an unchecked union type if the type lacks
+        default discriminant values.
+
+The rule for Output and Input seemed exactly backwards to me.
+
+I finally figured it out when I read the AI appendix, but it seems like
+an AARM note (or even a user NOTE) could really help here.  The trick
+is that the default implementation of Output and Input just turn around
+and call 'Write/'Read when the type has default discriminant values,
+so there is no need for them to directly raise Program_Error.  That
+will happen as soon as 'Write/'Read are called, unless the user has
+overridden 'Write or 'Read.  On the other hand, if the type lacks
+default discriminant values, then it is the job of Output/Input to
+write/read them, and we want *that* to raise Program_Error.
+
+Or we could augment the second bullet to:
+
+      * Execution of the default implementation of the Output or Input
+        attribute of an unchecked union type if the type lacks
+        default discriminant values Redundant:[ (as this is when
+        these attributes do more than simply invoke the corresponding
+        Write or Read attribute)].
+
+*************************************************************
+

Questions? Ask the ACAA Technical Agent