RE: question about subtyping and type annotations

> Another question is what the negative impact, if any, is when 
> returning say 
> xs:byte when xs:integer is the static type(apart from Per 
> Bothner's confusion 
> when investigating these corner cases).

The only negative impact I can see is that some type errors won't be
detected, for example if the value is passed to a function that requires an
xs:byte. But that's true for any expression that returns a subtype of the
declared type, or for example if the result of 1+1 is delivered as an
xs:short - which to my mind is clearly allowed.

Michael Kay
http://www.saxonica.com/

Received on Friday, 24 February 2006 18:13:12 UTC