[Bug 3675] fn:error(..) as an argument to another function/operator

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





------- Comment #2 from mike@saxonica.com  2006-09-08 11:57 -------
I don't normally follow static typing discussions, because I decided long ago
that the facility wasn't a good idea from a usability perspective. But surely,
using error() should never cause a static type error. The whole point of
error() is that it enables applications to detect errors dynamically, and if
the simple existence of a call on error() can cause a static failure, then
something is badly broken.

I guess this example is very artificial, a more realistic example would be

zero-or-one(if ($x=0) then error() else (1 div $x))

How does static typing handle that one?

Michael Kay

Received on Friday, 8 September 2006 11:58:03 UTC