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 4277 - CastAs672
Summary: CastAs672
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.2
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-26 10:52 UTC by Michael Kay
Modified: 2009-06-01 22:37 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2007-01-26 10:52:11 UTC
The query CastAs672 reads:

let $var := ("a","b","c") cast as xs:ENTITY 
return $var instance of xs:ENTITY

and the expected result is a dynamic error.

However, I believe that the rules on "errors and optimization" allow the value true to be returned. Static type inference can deduce that the result of the expression is either true or an error; the rules in 2.1 therefore allow the system to return true without checking for the error.

This conclusion is not obvious from a reading of section 2.1, but I believe it is correct. Section 2.1 doesn't allow the system to dispense with cardinality checks on a sequence that is wholly or partly evaluated; but it does allow such checks to be skipped in the case of a sequence that is not evaluated at all, because the value of the sequence is never used, and I believe that is the case here.

Suggestion: change the test to

("a","b","c") cast as xs:ENTITY 

which forces the error.
Comment 1 Carmelo Montanez 2007-03-09 14:29:50 UTC
Mike:

Thanks for teh comment.  Changed test as suggested.

Thanks,
Carmelo
Comment 2 Michael Kay 2009-06-01 22:37:11 UTC
Despite comment #1, it appears this bug is still present in the test suite. I'm fixing it by changing the query to

let $var := ("a","b","c") cast as xs:ENTITY 
return count($var) lt 10