[Bug 2789] Substitutability of duration subtypes

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2789





------- Additional Comments From mike@saxonica.com  2006-02-01 19:36 -------
"Sorry, but a cast cannot return a more specific dynamic type than the static 
type."

I've asked myself this question a number of times, and have come to the
conclusion that the result of a cast *can* be a subtype of the type requested. I
think it is a general property of our processing model (see 2.2.3.2) that
expressions can return a value whose dynamic type is a subtype of the type
implied by the static signature. For example the specification requires that the
result of 1+1 is an xs:integer, and an implementation that returns a value of
type xs:short conforms to this requirement because every xs:short is an
xs:integer. By the same reasoning it is acceptable for xs:int(1+1) to return a
value whose most specific type is xs:short. 

In Saxon, casting to a supertype is generally a no-op, and I believe this is
conformant.

Received on Wednesday, 1 February 2006 19:38:17 UTC