Bug #2938
closedmap{x: y} instance of function(X) as Y
100%
Description
An instance of test in which the LHS is a map, and the RHS is a specific function type, is returning false when it should return true.
For example test case map-merge-003-hof: the following assertion should be true
map{"a", 1 to 5} instance of function(xs:anyURI) as xs:integer*
The rules here are rather technical. They are covered by the itemType-subType() judgement, specifically:
Rule 35 [A is a subtype of B if] Ai is map(K, V), and Bi is function(xs:anyAtomicType) as V?.
Rule 26 [A is a subtype of B if] Ai is function(a1) as Ar, Bi is function(b1) as Br, Br is a subtype of Ar, and b1 is a subtype of a1.
We have a map here whose values are all sequences of integers, therefore it is an instance of map(X, xs:integer*) for some X, therefore it is an instance of function(xs:anyAtomicType) as xs:integer*, therefore it is an instance of function(xs:anyURI) as xs:integer*.
Essentially a map is an instance of function(X) as Y if (a) X is a subtype of xs:anyAtomicType, and (b) all the values in the map are instances of Y.
Updated by Michael Kay about 8 years ago
- Category set to XPath conformance
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Priority changed from Low to Normal
- Applies to branch 9.7, 9.8 added
- Fix Committed on Branch 9.7, 9.8 added
Fix committed by adding logic to SpecificFunctionType.matches()
Updated by O'Neil Delpratt about 8 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.7.0.10 added
Bug fix applied in the Saxon 9.7.0.10 maintenance release
Updated by O'Neil Delpratt over 7 years ago
- Applies to branch deleted (
9.8) - Fix Committed on Branch trunk added
- Fix Committed on Branch deleted (
9.8)
Please register to edit this issue