This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 30016 - [xslt30ts] Tests cvt-015 and cvt-016
Summary: [xslt30ts] Tests cvt-015 and cvt-016
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Abel Braaksma
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-19 23:08 UTC by Michael Kay
Modified: 2016-12-16 12:02 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2016-11-19 23:08:26 UTC
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:

<out>{if ($d gt 1000) then 4 else function($x, $y){$x + $y}}</out>

The "else" 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's room for debate here about whether the stylesheet contains a construct whose evaluation would never succeed. However, I think it'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.
Comment 1 Michael Kay 2016-12-16 12:02:23 UTC
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.