Version 1.1 of ai12s/ai12-0421-1.txt

Unformatted version of ai12s/ai12-0421-1.txt version 1.1
Other versions for file ai12s/ai12-0421-1.txt

!standard 6.1.1(18/5)          21-01-14 AI12-0421-1/01
!standard 6.1.1(18.1/4)
!standard 6.1.1(18.2/4)
!class binding interpretation 21-01-14
!status work item 21-01-14
!status received 21-01-14
!priority Low
!difficulty Easy
!qualifier Omission
!subject Legality checks for class-wide Pre and Post
!summary
*** TBD.
!question
The rule "and the corresponding expression would be illegal" in 6.1.1(18.2/4) seems too broad.
Consider:
package Pkg is package P1 is type T1 is tagged null record; function F (F1 : T1; Flag : Boolean := False); procedure Op (X1 : T1) with Pre'Class => F (F1 => X1); end P1;
package P2 is type T2 is new P1.T1 with null record; overriding function F (F2 : T2; Flag : Boolean := True); overriding procedure Op (X2 : T2); end P2; end Pkg;
Applying the transformation described in 6.1.1(18.1/4), we get a class-wide precondition expression for P2.Op of
F (F1 => X2)
It seems like this "would be illegal" because of the type mismatch between the formal and the actual parameters; that is not what we want or intended. Incidentally, note that P1.F is being called here, not P2.F; if it were otherwise, then we would need to talk about the value of the Flag parameter.
Should this be corrected? (Yes.)
!recommendation
(See Summary.)
!wording
*** TBD.
!discussion
** Temporary discussion **
This question came from the AARM Review of Steve Baird.
Randy suggested that we need an additional transformation bullet to talk about the inherited subprograms of a descendant of T. Something like:
* References of primitive subprograms of an ancestor of T other than S are replaced by to the corresponding subprograms inherited by the descendant of T (even if those are hidden by subsequent overridding).
Tucker noted that the Dynamic Semantics does the right thing without needing any transformation. He suggests that we don't need this rule at all.
Randy is skeptical of that. This rule came from the Ada 2012 corrigendum. There is no way we would have constructed such a complete fiction and check if we didn't have examples that needed this legal recheck.
We need to research the origin of this rule to see of some other formulation would work. A brief look at AI12-0113-1 and AI12-0170-1 shows a bunch of wild examples using interfaces and other abstract types. As we've passed the agenda deadline, it's too late to craft a solution.
!ASIS
No ASIS effect.
!ACATS test
!appendix

****************************************************************

Questions? Ask the ACAA Technical Agent