ACTION A-644-03

ACTION A-644-03 Tim to revise his proposal in bug 29586 "The judgement 
subtype-itemtype(Ai, Bi)" with changes from today's discussion

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29586

In "2.5.5.8 Map Test", replace the text

"The function signature of the map, ... the required return type."

with

"The function signature of a map matching type map(K, V), treated as a 
function, is function(xs:anyAtomicType) as V?.  It is thus always a 
subtype of function(xs:anyAtomicType) as item()* regardless of the 
actual types of the keys and values in the map. The rules for function 
coercion mean that any map can be supplied as a value in a context where 
the required type has a more specific return type, such as 
function(xs:anyAtomicType) as xs:integer, even when the map does not 
match in the sense required to satisfy the instance of operator. In such 
cases, a type error will only occur if an actual call on the map 
(treated as a function) returns a value that is not an instance of the 
required return type."

Similarly, in "2.5.5.9 Array Test", replace the text

"The function signature of the array, ... the required return type."

with

"The function signature of an array matching array(X), treated as a 
function, is function(xs:integer) as X.  It is thus always a subtype of 
function(xs:integer) as item()* regardless of the actual member types in 
the array.  The rules for function coercion mean that any array can be 
supplied as a value in a context where the required type has a more 
specific return type, such as function(xs:integer) as xs:integer, even 
when the array does not match in the sense required to satisfy the 
instance of operator. In such cases, a type error will only occur if an 
actual call on the array (treated as a function) returns a value that is 
not an instance of the required return type."

Received on Thursday, 26 May 2016 08:43:58 UTC