<?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>1460</bug_id>
          
          <creation_ts>2005-05-17 16:52:02 +0000</creation_ts>
          <short_desc>Error code for casting errors</short_desc>
          <delta_ts>2005-09-29 11:20:24 +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 2.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Don Chamberlin">chamberl</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>3152</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2005-05-17 16:52:02 +0000</bug_when>
    <thetext>What error code do you get if you try to cast from a source type to a target
type for which casting is not permitted (e.g. cast integer to anyURI)?

The language book (3.12.3 4f) says:

For any combination of input type and target type that is not in the above list,
a cast expression raises a type error [err:XPTY0004].

F+O (section 17) says:

If casting is attempted from an ST to a TT for which casting is not supported,
an error is raised [err:FORG0001].

(Yet another illustration of the problems caused by describing casting in more
than one place.)

The casting tests in the test suite seem to assume the XPTY0004 is correct.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3155</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2005-05-17 17:23:17 +0000</bug_when>
    <thetext>Casting are runtime errors and do not fall into the category of type errors, 
however, if no instance of a type can be cast to another type, you can raise 
the error statically...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3123</commentid>
    <comment_count>2</comment_count>
    <who name="Ashok Malhotra">ashok.malhotra</who>
    <bug_when>2005-05-19 21:58:32 +0000</bug_when>
    <thetext>This was discussed in the joint QT WG meeting on 5/19/2005 and it was decided to
change the error code in the F&amp;O to conform to the error code in the language
documents:  XPTY0004.

Ashok Malhotra</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>