W3C home > Mailing lists > Public > www-ql@w3.org > January to March 2006

RE: question about subtyping and type annotations

From: Michael Kay <mhk@mhk.me.uk>
Date: Fri, 24 Feb 2006 18:12:57 -0000
To: "'Frans Englich'" <frans.englich@telia.com>, <www-ql@w3.org>
Message-ID: <E1FChRF-0006Sz-HZ@lisa.w3.org>

> 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
Received on Friday, 24 February 2006 18:13:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:43:44 UTC