CVS difference for ai12s/ai12-0233-1.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai12s/ai12-0233-1.txt

--- ai12s/ai12-0233-1.txt	2017/06/10 04:24:23	1.2
+++ ai12s/ai12-0233-1.txt	2017/10/12 02:12:29	1.3
@@ -1,4 +1,4 @@
-!standard 6.1.1(38/4)                                  17-06-09  AI12-0233-1/01
+!standard 6.1.1(38/4)                                  17-10-11  AI12-0233-1/02
 !class binding interpretation 17-06-09
 !status work item 17-06-09
 !status received 17-04-13
@@ -8,6 +8,11 @@
 !subject Pre'Class for hidden operations of private types
 !summary
 
+At a call, a precondition check is performed based on the Pre'Class
+conditions that apply to the callable *entity* denoted by the name or
+prefix used in the call. This is true even if the *view* (as opposed to
+the entity) denoted by the call does not itself have any applicable Pre'Class
+conditions.
 
 !question
 
@@ -54,12 +59,22 @@
 
 !wording
 
-[Editor's note: There doesn't seem to be a need to change wording, if in fact
-the group agrees with the analysis in the !discussion. In that case, this AI
-needs to be rewritten as a Ramification.]
+[No changes required.]
 
 !discussion
 
+Unlike the Pre aspect, the applicable Pre'Class aspect at the point of
+call is determined by the *entity* denoted by the name used in the call,
+as apposed to the body invoked.  What this means is that upon entry to
+the invoked body, the body may presume only the weakest Pre'Class
+condition that a caller might have checked.
+
+On the other hand, the particular *view* of the denoted entity does not
+figure into determining what Pre'Class conditions apply.  This means
+that if a procedure overrides an inherited subprogram that has an
+applicable Pre'Class aspect, but the overriding is not visible to the
+caller, the inherited Pre'Class aspect still applies.
+
 6.1.1(38/4) says:
 
    "The class-wide precondition check for a call to a subprogram or entry S
@@ -68,8 +83,8 @@
    invoked). ..."
 
 Because this says the "callable entity," that implies that Pre'Class is
-checked, even though the caller has no idea that this is going to happen
-(without looking in the private part).
+checked based on the denoted subprogram, independent of the view of that
+entity.
 
 ---
 
@@ -103,9 +118,24 @@
 the subprogram declaration illegal (since the declaration is implicit, so
 such a rule really affects the type declaration). That would be incompatible,
 but only at the margins (only for routines with non-trivial preconditions
-that are overriding). ** I'm not going to look at this possibility further,
-but it may be worth considering. After all, that's how similar cases with
-interfaces were resolved. **
+that are overriding). We have chosen the compatible approach for now,
+the a compiler or other tool could certainly enforce a restriction against
+this sort of overriding.
+
+Note that there is a separate issue, probably deserving its own AI,
+having to do with renaming-as-body.  Because a renaming-as-body is a
+distinct entity from the renamed subprogram, a renaming-as-body should
+probably be illegal unless Pre'Class of True applies to the renamed
+subprogram, or any Pre'Class aspect that applies to the renamed
+subprogram also applies to the renaming.  This is a modest
+generalization of the rule in 6.1.1(17/3):
+
+  If a renaming of a subprogram or entry S1 overrides an inherited
+  subprogram S2, then the overriding is illegal unless each class-wide
+  precondition expression that applies to S1 fully conforms to some
+  class-wide precondition expression that applies to S2 and each
+  class-wide precondition expression that applies to S2 fully conforms
+  to some class-wide precondition expression that applies to S1.
 
 !ASIS
 
@@ -408,3 +438,14 @@
 
 ****************************************************************
 
+From: Tucker Taft
+Sent: Wednesday, October 11, 2017  4:02 PM
+
+Here is a write-up of the AI about Pre'Class as it applies to calls on
+privately overridden operations. [This is version /02 of the AI - Editor.]
+
+Note that there might be an issue with calls on subprograms that are completed
+by a renaming-as-body, perhaps deserving its own AI.  This AI's !discussion
+mentions this issue.
+
+****************************************************************

Questions? Ask the ACAA Technical Agent