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 29260 - Array Tests: function tests
Summary: Array Tests: function tests
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-03 19:41 UTC by Christian Gruen
Modified: 2015-11-10 17:21 UTC (History)
0 users

See Also:


Attachments

Description Christian Gruen 2015-11-03 19:41:37 UTC
This is inspired by the (closed) Bug 29220: In analogy with the map type rules, it could make sense to explain typing of arrays in more detail. The following paragraph or a similar one could be added to 2.5.5.9 of the XPath and XQuery 3.1 specs (...provided that it's correct):

"The function signature of the array, treated as a function, is always function(xs:integer) as item()*, regardless of the actual member types in the array. This means that a function item type with a more specific return type, such as function(xs:integer) as xs:integer, does not match an array in the sense required to satisfy the instance of operator. However, the rules for function coercion mean that any array can be supplied as a value in a context where such a type is the required type, and a type error will only occur if an actual call on the array (treated as a function) returns a value that is not an instance of the required return type."
Comment 1 Jonathan Robie 2015-11-10 17:21:59 UTC
I'll do this.