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

[Bug 4272] [FS] Type checking fn:data

From: <bugzilla@wiggum.w3.org>
Date: Wed, 28 Feb 2007 07:38:38 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1HMJOY-00075o-Vt@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4272





------- Comment #7 from tim@cbcl.co.uk  2007-02-28 07:38 -------
OK thanks.  Here's an example of why doing anything other raising an error at
runtime is a "bad thing".

declare function local:if-data($test as item()*, $data as item()*) 
{
  if (fn:boolean($test))
    return fn:data($data);
  else
    return ();
};

This wouldn't pass static type checking because of the differences between the
declared argument types of fn:boolean and fn:data, yet at first glance (or
without static type checking) is fine.
Received on Wednesday, 28 February 2007 07:38:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:19 GMT