<?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>16370</bug_id>
          
          <creation_ts>2012-03-14 15:59:59 +0000</creation_ts>
          <short_desc>[XQ30] Does a TryCatch expression catch a type error raised during the static analysis phase?</short_desc>
          <delta_ts>2012-06-12 16:54:22 +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>XQuery 3.0</component>
          <version>Working drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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="Ghislain Fourny">g</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>jim.melton</cc>
    
    <cc>mike</cc>
          
          <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>65519</commentid>
    <comment_count>0</comment_count>
    <who name="Ghislain Fourny">g</who>
    <bug_when>2012-03-14 15:59:59 +0000</bug_when>
    <thetext>In section 2.3.1 (Kinds of errors) it is said that &quot;a type error may be raised during the static analysis phase or the dynamic evaluation phase.&quot;

Section 3.15 (TryCatch Expressions) says

1. &quot;A try/catch expression catches dynamic errors and type errors raised during dynamic evaluation for expressions that are lexically contained within the try clause,&quot;
2. &quot;if the target expression raises a dynamic error or a type error, [catch clause evaluated]&quot; (with no further precision on type error)
3. &quot;Static errors are not caught by the try/catch expression.&quot;

I am a bit unsure about when type errors are caught, as I could not find a specific sentence for type errors raised statically (maybe I just missed it).

If we distinguish between type errors raised statically and those raised dynamically, it might lead to a behavior which is hard to predict within an implementation and between implementations.

Should we make a try catch expression also catch type errors when they are raised during the static analysis phase (in which case, as a rule of thumb, I guess an optimizer could replace the trycatch expression with the matching catch expression)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65536</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-03-14 17:48:32 +0000</bug_when>
    <thetext>I think the rule is that if type errors are raised statically then you can&apos;t catch them.

I notice that XSLT 3.0 is not clear about whether xsl:try/xsl:catch catches type errors. It only speaks of dynamic errors being caught.

We already have a lack of interoperability caused by allowing implementations to decide whether to raise type errors statically or dynamically. I don&apos;t think try/catch makes this significantly worse. Anyone who catches type errors and tries to recover from them needs to know that this won&apos;t work on an implementation that detects them statically.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67430</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-05-07 19:15:25 +0000</bug_when>
    <thetext>I agree with Mike Kay&apos;s interpretation in Comment #1.

See also the discussion in Bug 10848.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68866</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-06-07 22:20:19 +0000</bug_when>
    <thetext>Ghislain - have we answered your question, or is there an outstanding issue here that needs to be resolved?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69003</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-06-12 16:50:36 +0000</bug_when>
    <thetext>The WG believes the spec is clear on this point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69004</commentid>
    <comment_count>5</comment_count>
    <who name="Ghislain Fourny">g</who>
    <bug_when>2012-06-12 16:54:22 +0000</bug_when>
    <thetext>Yes, it makes sense. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>