<?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>20643</bug_id>
          
          <creation_ts>2013-01-11 09:51:45 +0000</creation_ts>
          <short_desc>[XP3.0] Formal and informal definitions of derives-from() do not match</short_desc>
          <delta_ts>2013-06-19 10:07:10 +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>XPath 3.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://www.w3.org/Bugs/Public/show_bug.cgi?id=20632</see_also>
          <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="Jonathan Robie">jonathan.robie</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>81225</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-01-11 09:51:45 +0000</bug_when>
    <thetext>This is transferred from the comment made by email here:

https://lists.w3.org/Archives/Member/w3c-xsl-query/2013Jan/0003.html

We say in 2.5.5

derives-from( AT, ET ) returns true if AT is derived from ET by 
restriction or extension, or if ET is a union type of which AT is a 
member type.

If this were the case, then when a function expects union(xs:string, 
xs:decimal), it would be a type error to supply an xs:integer. 
Furthermore, &quot;union type&quot; should be &quot;pure union type&quot;.

This sentence is immediately followed by a paraphrase that says 
&quot;formally, ...&quot;, and the paraphrase gives the a more complete definition. But 
there is no indication that the sentence quoted is to be regarded as 
incomplete or informal.

A better definition might be:

derives-from( AT, ET ) returns true if any of the following conditions 
applies:

* AT is ET
* ET is the base type of AT
* ET is a pure union type of which AT is a member type
* There is a type MT such that derives-from(AT, MT) and derives-from(MT, ET)

The problem is exemplified by test instanceof138. The expected result 
for this test assumes that restrictedDate is substitutable for a union 
type that includes the base type of restrictedDate as one of its members.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81953</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2013-01-22 17:34:36 +0000</bug_when>
    <thetext>The Working Group accepted the proposed change.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>