<?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>30016</bug_id>
          
          <creation_ts>2016-11-19 23:08:26 +0000</creation_ts>
          <short_desc>[xslt30ts] Tests cvt-015 and cvt-016</short_desc>
          <delta_ts>2016-12-16 12:02: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 Test Suite</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</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="Abel Braaksma">abel.online</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>128233</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-11-19 23:08:26 +0000</bug_when>
    <thetext>I think these two tests can legitimately throw a type error.

The tests were introduced to test bug 20874 concerning the use of curly braces in a value template. cvt-016 has:

&lt;out&gt;{if ($d gt 1000) then 4 else function($x, $y){$x + $y}}&lt;/out&gt;

The &quot;else&quot; branch never executes, of course, but I think a type error can be reported statically here, because functions can never be atomized.

The rules here are expressed somewhat informally:

an implementation may signal a type error during the analysis phase in the same way as a static error, even if it occurs in part of the stylesheet that is never evaluated, provided it can establish that execution of a particular construct would never succeed

There&apos;s room for debate here about whether the stylesheet contains a construct whose evaluation would never succeed. However, I think it&apos;s within the spirit of the rules to raise a compile-time error here: if the else branch were executed, then evaluation of the value template would fail with a type error.

Allowing a type error here would not compromise the purpose of the test, which is to check that this construct can be parsed. But the purpose of the test would be better satisfied (at least with XP 3.1) with an array constructor, where there is no type error because atomization can succeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128327</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-12-16 12:02:23 +0000</bug_when>
    <thetext>I have changed the tests to allow a type error.

Test cvt-041 was added to use an array constructor, forcing the use of a close-curly at the end of the nested expression.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>