CVS difference for ai22s/ai22-0067-1.html

Differences between 1.1 and version 1.2
Log of other versions for file ai22s/ai22-0067-1.html

--- ai22s/ai22-0067-1.html	2023/03/23 07:47:03	1.1
+++ ai22s/ai22-0067-1.html	2023/05/27 07:11:57	1.2
@@ -1,19 +1,23 @@
-<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>AI22-0067-1/00</title>
+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><title>AI22-0067-1/01</title>
 <style type="text/css">
 table td,table th{padding:0}
 BODY.body{background-color:#ffffff; max-width:468pt; padding:72pt 72pt 72pt 72pt}
 P.head{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:14pt; padding-bottom:0pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:
400; text-decoration:none; vertical-align:baseline; font-style:normal}
 H2.head{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:12pt; color:#000000; font-size:14pt; padding-bottom:6pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; page-break-after:avoid; orphans:2; widows:2; tex
t-align:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
+P.inst{margin-bottom:0; margin-top:0; margin-left:18pt; margin-right:0; padding-top:9pt; color:#000000; font-size:12pt; padding-bottom:6pt; font-family:"Arial","Liberation Sans",sans-serif;line-height:1.15; orphans:2; widows:2; text-align:left; font-weigh
t:400; text-decoration:none; vertical-align:baseline; font-style:normal}
+P.word{margin-bottom:0; margin-top:0; margin-left:36pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:3pt; font-family:"Times New Roman","Times",serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:40
0; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.wrds{margin-bottom:0; margin-top:0; margin-left:36pt; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:12pt; font-family:"Times New Roman","Times",serif; line-height:1.15; orphans:2; widows:2; text-align:left; font-weight:4
00; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.codb{margin-bottom:0; margin-top:0; margin-left:12pt; margin-right:0; padding-left:4pt; padding-top:4pt; color:#000000; font-size:10pt; padding-bottom:4pt; font-family:"Courier New",monospace; line-height:1.15; text-align:left; background-color:#f0f0f0;
 font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 P.text{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:0pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; text-align:left; font-weight:400; text-decoration:
none; vertical-align:baseline; font-style:normal}
 P.txts{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0; padding-top:0pt; color:#000000; font-size:11pt; padding-bottom:11pt; font-family:"Arial","Liberation Sans",sans-serif; line-height:1.15; text-align:left; font-weight:400; text-decoration
:none; vertical-align:baseline; font-style:normal}
+SPAN.ins{color:#007700}
+SPAN.ntrm{font-family:"Arial","Liberation Sans",sans-serif}
 P.l3h{margin-bottom:0; margin-top:0; margin-left:0; margin-right:0;color:#000000;font-size:26pt;font-family:"Arial","Liberation Sans",sans-serif; padding-top:0pt; padding-bottom:3pt; line-height:1.15; page-break-after:avoid; orphans:2; widows:2; text-alig
n:left; font-weight:400; text-decoration:none; vertical-align:baseline; font-style:normal}
 </style>
 </head><body class="body"><p class="l3h">AI22-0067-1</p>
 <p class="head">!standard 4.3(4/5) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;23-03-23 &nbsp;AI22-0067-1/00</p>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;23-05-19 &nbsp;AI22-0067-1/01</p>
 <p class="head">!class binding interpretation 23-03-23</p>
 <p class="head">!status work item 23-03-23</p>
 <p class="head">!status received 23-03-23</p>
@@ -22,22 +26,42 @@
 <p class="head">!qualifier Omission</p>
 <p class="head">!subject The nominal subtype of an aggregate</p>
 <h2 class="head">!summary</h2>
-<p class="text">The nominal subtype of an aggregate is defined.</p>
+<p class="text">The nominal subtype of an aggregate is defined. For all cases but delta_aggregates,
+the nominal subtype is constrained by the discriminants/bounds of the aggregate being defined. For
+a delta_aggregate, the nominal subtype is that of the <i>base_</i>expression.</p>
 <h2 class="head">!issue</h2>
-<p class="text">3.3(23/5) starts &quot;At the place where a view of an object is defined, a
-nominal</p>
-<p class="text">subtype is associated with the view.&quot; 4.3(5) states that an aggregate is a</p>
-<p class="text">view of an object. But nowhere do we define the nominal subtype of an</p>
-<p class="text">aggregate.</p>
+<p class="text">3.3(23/5) starts &quot;At the place where a view of an object is defined, a nominal
+subtype is associated with the view.&quot; 4.3(5) states that an aggregate is a view of an object.
+But nowhere do we define the nominal subtype of an aggregate.</p>
 <h2 class="head">!recommendation</h2>
 <p class="text">(See Summary.)</p>
 <h2 class="head">!wording</h2>
-<p class="text">** TBD.</p>
-<p class="text">[The details of the definition are TBD. Most likely, the &quot;nominal&quot;
-subtype of an aggregate would be anonymous and be a constrained subtype with the
-bounds/discriminants of the aggregate. The rule would either go in static semantics for 4.3, or
-perhaps in each of the individual subclauses (which would separate the
-discriminant/bounds/container cases).]</p>
+<p class="inst">Add after 4.3.1(20):</p>
+<p class="word">The nominal subtype of a <span class="ntrm">record_aggregate</span> is constrained
+by the values defined for the discriminants, if any.</p>
+<p class="inst">Add after 4.3.2(8/3):</p>
+<p class="word">The nominal subtype of an <span class="ntrm">extension_aggregate</span> is
+constrained by the values defined for the discriminants, if any, of the object defined by the
+<span class="ntrm">aggregate</span>.</p>
+<p class="inst">Add after 4.3.3(31):</p>
+<p class="word">The nominal subtype of an <span class="ntrm">array_aggregate</span> (other than a
+subaggregate) is constrained by the values defined for its bounds and those of any
+subaggregates.</p>
+<p class="inst">Add after 4.3.4(21/5):</p>
+<p class="word">The nominal subtype of a <span class="ntrm">delta_aggregate</span> is that of its
+<i>base_</i><span class="ntrm">expression</span>.</p>
+<p class="inst">Add after 4.3.5(53/5):</p>
+<p class="word">The nominal subtype for an indexed aggregate is the return subtype of the
+New_Indexed function. &nbsp;The nominal subtype for any other container aggregate is the return
+subtype of the Empty function.</p>
+<p class="inst">Modify B.3.3(20/2):</p>
+<p class="word">A view of an unchecked union object (including a type conversion or function call)
+has <i>inferable discriminants</i> if it has a constrained nominal subtype, unless
+<span class="ins">{either}</span> the object is a component of an enclosing unchecked union object
+that is subject to a per-object constraint and the enclosing object lacks inferable
+discriminants<span class="ins">{, or the object is a view of an
+<span class="ntrm">extension_aggregate</span>, and the <span class="ntrm">ancestor_part</span> is
+an expression of an unchecked union subtype that lacks inferable discriminants}</span>.</p>
 <h2 class="head">!discussion</h2>
 <p class="txts">Most of the rules that use the nominal subtype of an object don&#39;t apply to
 aggregates, at least for Ada 2012.</p>
@@ -81,22 +105,26 @@
 question, we need to know the nominal subtype of the aggregate. And we really don&#39;t want (1)
 raising Program_Error, since the discriminants involved are known and static.</p>
 
-<p class="txts">So we could fix both of the identified problems by specific rules; carving out an
-exception to the general rule that objects have a nominal subtype, and adding a specific rule about
-aggregates that are unchecked unions.</p>
+<p class="txts">So we could potentially fix both of the identified problems by specific rules;
+carving out an exception to the general rule that objects have a nominal subtype, and adding a
+specific rule about aggregates that are unchecked unions.</p>
 
 <p class="txts">However, we have a number of proposals for composite case statements in the
 pipeline. Assuming that coverage would work the same for those as it does for discrete subtypes,
 the nominal subtype would become much more important. And it would not be surprising to find/create
 other cases where the nominal subtype is required.</p>
 
-<p class="text">As such, we recommend that the nominal subtype be defined, and it be defined as
+<p class="txts">As such, we recommend that the nominal subtype be defined, and it be defined as
 tightly as possible, so that the unchecked union case and the case statement case require only what
 is necessary. (Simply defining all aggregates as unconstrained would not be a good idea.)</p>
+
+<p class="text">As can be seen from the proposed !wording section, we have defined the nominal
+subtypes for all but delta_aggregates to be constrained by the discriminants/bounds of the
+aggregate object being defined. Delta_aggregates inherit the nominal subtype of their base
+expression, whatever that happens to be.</p>
 <h2 class="head">!ACATS test</h2>
-<p class="text">ACATS tests might be necessary to check that the appropriate effects occur.</p>
-<p class="text">The example given in the !discussion probably should be an ACATS C-Test,</p>
-<p class="text">for instance.</p>
+<p class="text">ACATS tests might be necessary to check that the appropriate effects occur. The
+example given in the !discussion probably should be an ACATS C-Test, for instance.</p>
 <h2 class="head">!appendix</h2>
 <p class="txts">The original mail on this topic is filed in AI12-0066-1.</p>
 

Questions? Ask the ACAA Technical Agent