Project

Profile

Help

Bug #4203

closed

XQuery: Maps and type declarations

Added by Christian Grün almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2019-04-24
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
9.9, trunk
Fix Committed on Branch:
9.9, trunk
Fixed in Maintenance Release:
Platforms:

Description

Both of the following expressions return A and B (as expected):

let $s as map(xs:anyAtomicType, xs:string) := map { 1:'A','x':'B' }
return $s?*

let $s as function(xs:string) as xs:string := map { 1:'A','x':'B' }
return $s?*

I understand why the xs:string parameter type is valid in the second expression (the map can be called with all kinds of atomic types as arguments).

The following expression raise an error, though (with Saxon-EE 9.9.1.2J):

let $s as function(xs:anyAtomicType) as xs:string := map { 1:'A','x':'B' }
return $s?*

XPTY0004: The required item type of the value of variable $s is
  (function(xs:anyAtomicType) as xs:string)

Please register to edit this issue

Also available in: Atom PDF