[Bug 29119] [XP31] xs:error always raises a type error

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29119

--- Comment #8 from Jonathan Robie <jonathan.robie@gmail.com> ---
In Comment #7, Mike Kay wrote:

> The essence of xs:error is that it's a type with no instances. That should be enough to answer all questions about it. It shouldn't get any special treatment. From this simple fact, everything else follows without any special rules:

At the very least, we need test cases in the test suite for this, because
implementations are not getting this right.  To me, the fact that
implementations are not getting this right is one indication that this is not
"just falling out".

But I think the fact that it's a type with no instances also tells us that it
is never useful in a SequenceType production.  Why would anyone ever write "12
instance of xs:error" instead of "false()", or write functions that can only
fail if called? It's hard to imagine a query where using xs:error as a
SequenceType is useful, and it's easy to imagine it being a mistake. Don't we
help the user by pointing this out?

As a SequenceType, xs:error is always an exception. A SequenceType is used to
describe the type of an XQuery 3.1 value, and xs:error can never be the type of
an XQuery 3.1 value.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 6 October 2015 09:34:18 UTC