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

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 UTC