<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29686</bug_id>
          
          <creation_ts>2016-06-04 15:54:29 +0000</creation_ts>
          <short_desc>[xslt3.0] Imprecise language for rules on xsl:override</short_desc>
          <delta_ts>2016-10-06 18:42:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>126672</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-04 15:54:29 +0000</bug_when>
    <thetext>We say for xsl:override of functions, &quot;The types of the arguments are pairwise identical....  The return types are identical.&quot;

It would be more precise to say what we mean by &quot;the type of&quot;, e.g. to talk of &quot;the declared type, defaulting to item()*&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126714</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-09 16:23:34 +0000</bug_when>
    <thetext>Abel asks: does XPath have a definition of type equality, e.g. is union(A,B) identical to union(B,A)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126717</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-09 17:49:02 +0000</bug_when>
    <thetext>The answer to the question in comment #2 is that we do have a definition of &quot;identical types&quot; in 3.5.3.3:

[Definition: Types S and T are considered identical for the purpose of these rules if and only if subtype(S, T) and subtype(T, S) both hold, where the subtype relation is defined in Section 2.5.6.1 The judgement subtype(A, B) XP30.]

This rule means, for example, that union(double, decimal) is the same type as union(decimal, double).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126719</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-09 22:15:49 +0000</bug_when>
    <thetext>The language has been tightened up a little:


&lt;p&gt;The &lt;phrase diff=&quot;chg&quot; at=&quot;T-bug29686&quot;&gt;declared types of the arguments 
   (defaulting to &lt;code&gt;item()*&lt;/code&gt;)&lt;/phrase&gt; are pairwise &lt;termref
    def=&quot;dt-identical-types&quot;&gt;identical&lt;/termref&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;phrase diff=&quot;chg&quot; at=&quot;T-bug29686&quot;&gt;declared return types 
   (defaulting to &lt;code&gt;item()*&lt;/code&gt;)&lt;/phrase&gt; are 
   &lt;termref def=&quot;dt-identical-types&quot;&gt;identical&lt;/termref&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126786</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-16 16:21:52 +0000</bug_when>
    <thetext>Reopened because there was discussion about whether this definition of &quot;identical&quot; actually works - e.g. if untypedAtomic is supplied to union(double, decimal) the effect is different from when it&apos;s union(decimal, double).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126828</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-24 13:03:30 +0000</bug_when>
    <thetext>I have added a test case override-f-031</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126841</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-27 07:55:59 +0000</bug_when>
    <thetext>The WG discussed this on 23 June 2016. I was given an action to add a note going into more detail about the consequences of the rule on &quot;identical&quot; types, which I have done as follows:

&lt;p&gt;
Consider a function that accepts an argument whose declared type is a union type with member types &lt;code&gt;xs:double&lt;/code&gt; and &lt;code&gt;xs:decimal&lt;/code&gt;, in that order (we might write this as &lt;code&gt;union(xs:double, xs:decimal)&lt;/code&gt;). Using the same notation, this can be overridden by a function that declares the argument type as &lt;code&gt;union(xs:decimal, xs:double)&lt;/code&gt;. This does not affect type checking: a a function call that passes the type checking rules with one signature will also pass the type checking rules with the other. It does however affect the way that the function conversion rules work: a call that passes the &lt;code&gt;xs:untypedAtomic&lt;/code&gt; value &lt;code&gt;&quot;93.7&quot;&lt;/code&gt; (or an untyped node with this as its string value) will be converted to an &lt;code&gt;xs:decimal&lt;/code&gt; in one case and an &lt;code&gt;xs:double&lt;/code&gt; in the other.
&lt;/p&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126842</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-06-27 07:58:14 +0000</bug_when>
    <thetext>The WG discussed this on 23 June 2016. I was given an action to add a note going into more detail about the consequences of the rule on &quot;identical&quot; types, which I have done as follows:

&lt;p&gt;
Consider a function that accepts an argument whose declared type is a union type with member types &lt;code&gt;xs:double&lt;/code&gt; and &lt;code&gt;xs:decimal&lt;/code&gt;, in that order (we might write this as &lt;code&gt;union(xs:double, xs:decimal)&lt;/code&gt;). Using the same notation, this can be overridden by a function that declares the argument type as &lt;code&gt;union(xs:decimal, xs:double)&lt;/code&gt;. This does not affect type checking: a a function call that passes the type checking rules with one signature will also pass the type checking rules with the other. It does however affect the way that the function conversion rules work: a call that passes the &lt;code&gt;xs:untypedAtomic&lt;/code&gt; value &lt;code&gt;&quot;93.7&quot;&lt;/code&gt; (or an untyped node with this as its string value) will be converted to an &lt;code&gt;xs:decimal&lt;/code&gt; in one case and an &lt;code&gt;xs:double&lt;/code&gt; in the other.
&lt;/p&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>