Project

Profile

Help

Bug #2938

closed

map{x: y} instance of function(X) as Y

Added by Michael Kay over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2016-09-13
Due date:
% Done:

100%

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

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.

Actions #1

Updated by Michael Kay over 7 years ago

  • Description updated (diff)
Actions #2

Updated by Michael Kay over 7 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()

Actions #3

Updated by O'Neil Delpratt over 7 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

Actions #4

Updated by O'Neil Delpratt almost 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

Also available in: Atom PDF