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

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

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