Project

Profile

Help

Bug #4692

closed

MapTest as subtype of Function Type

Added by Michael Kay over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2020-08-23
Due date:
% Done:

100%

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

Description

See https://github.com/w3c/qt3tests/issues/28

Saxon is accepting map { 1:'A','x':'B' } as an instance of function(xs:anyAtomicType) as xs:string. But this is incorrect: if the map is treated as a function $F, then $F(23) returns () which is not an instance of the declared return type xs:string.

The logic in MapType.relationship() line 324 makes map(K, V) a subtype of F if function(K) as V is a subtype of F, which seems quite wrong; the rule is ยง2.5.6.2 rule 35, which says map(K, V), is a subtype of function(xs:anyAtomicType) as V?.

So both Saxon and the QT3 test appear to be wrong.

Please register to edit this issue

Also available in: Atom PDF