W3C home > Mailing lists > Public > public-qt-comments@w3.org > October 2007

[Bug 4273] [FS] data on element()

From: <bugzilla@wiggum.w3.org>
Date: Mon, 22 Oct 2007 09:17:39 +0000
To: public-qt-comments@w3.org
Message-Id: <E1IjtPn-0003qz-Cq@wiggum.w3.org>


------- Comment #9 from tim@cbcl.co.uk  2007-10-22 09:17 -------
declare variable $x as element(a, xs:anyType) external;
$x + 1

This fails static type checking because we cannot determine statically that
data($x) is convertible to a numeric value (ensuring that + is defined).  Note
that I believe data on xs:anyType to be xs:anyAtomicType* and not
xs:untypedAtomic as stated in the specification.

If we type check optimistically, it will pass and run to completion in the
event that the data($x) is convertible to a numeric value.  Otherwise a runtime
type check error will occur.  By type checking optimistically, the
implementation effectively introduces extra type constraints which it checks at
runtime.  It is as if the type of $x were treated as element(*, T) where T is
any type convertible (using fs:convert-operand) to a numeric type).

declare variable $x as element(a, xs:string) external;
$x + 1

As expected, this will fail type checking for all inputs.
Received on Monday, 22 October 2007 09:17:46 UTC

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