Actions
Bug #4692
closedMapTest as subtype of Function Type
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
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
Actions