W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2006

[Bug 2789] Substitutability of duration subtypes

From: <bugzilla@wiggum.w3.org>
Date: Wed, 01 Feb 2006 19:36:34 +0000
To: public-qt-comments@w3.org
Cc:
Message-Id: <E1F4NmM-00060A-20@wiggum.w3.org>

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:10 UTC