<?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>29619</bug_id>
          
          <creation_ts>2016-05-08 14:11:08 +0000</creation_ts>
          <short_desc>[FO31] Casting to abstract types</short_desc>
          <delta_ts>2016-05-24 16:07:18 +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>Functions and Operators 3.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</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="Abel Braaksma">abel.braaksma</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>126373</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-05-08 14:11:08 +0000</bug_when>
    <thetext>Common sense seems to dictate that casting to abstract types is not allowed. However, the only hint I could find is in places where the text mentions that casting to xs:NOTATION is not allowed *because* it is an abstract type.

The closest I got was in 19.3.2, which says:

&quot;It is always possible to cast an atomic value A to a type T if the relation A instance of T is true, provided that T is not an abstract type.&quot; 

However, this indicates that casting is *not always possible*. It doesn&apos;t (necessarily) say that casting to a parent that is abstract is *always* a failure.

Furthermore, sections 19.3.3 and 19.3.4 do not mention abstract types at all (and I&apos;m unsure the text there covers TT of abstract type).

Unless I am misunderstanding these sections, I propose to add a (tiny) section under 19.3, something like:

19.3.1 Casting to abstract types
If TT is an abstract type, casting always fails. It doesn&apos;t matter in this case if TT is a parent type of ST, or if TT is equal to ST.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126554</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-05-24 15:21:52 +0000</bug_when>
    <thetext>We concluded that the paragraphs in 9.1 that exclude casting to xs:NOTATION, xs:anyAtomicType, or xs:anySimpleType are adequate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126563</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-05-24 16:07:12 +0000</bug_when>
    <thetext>For sake of reference: during the discussion it became apparent that simple types cannot be abstract (by XSD rules), only complex types can, and that the text in the spec means &quot;abstract type&quot; in a different vein than the W3C XML Schema says.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>