RE: question about subtyping and type annotations

"Michael Kay" <[email protected]> Fri, 24 Feb 2006 18:12:57 -0000
Newsgroups gmane.comp.web.query-languages
Message-ID <[email protected]>
> 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/