W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2016

[Bug 29586] [XQ31] The judgement subtype-itemtype(Ai, Bi)

From: <bugzilla@jessica.w3.org>
Date: Tue, 10 May 2016 16:55:54 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29586-523-I1EGp9vPUY@http.www.w3.org/Bugs/Public/>

Abel Braaksma <abel.braaksma@xs4all.nl> changed:

           What    |Removed                     |Added
                 CC|                            |abel.braaksma@xs4all.nl

--- Comment #11 from Abel Braaksma <abel.braaksma@xs4all.nl> ---
(In reply to Tim Mills from comment #8)
> I'm lobbying to allow 
> function() { 1 } instance of function() as xs:integer 
I wrote in today's IRC chat that at present, at least two implementations of
XPath (this is an XQ bug but equally applies to XP) return "true" on that
query: Saxon and Exselt. I didn't try others.

Also, it is always a safe optimization to make the return type more specific if
you can, as anywhere the result of the function is needed, the more specific
result is also an instance of the more generic result. I.e., this succeeds:

I.e., the following returns "boo true", even though $g has return type item().

   let $g := function() { 1 }, 
   $f := function($h as function() as xs:decimal) { "boo" } 
   return ($f($g), $g instance of function() as xs:integer)

I think the spec already allows this.

So I don't agree with comments below that this expression should fail.

You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 10 May 2016 16:57:50 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 10 May 2016 16:57:50 UTC