This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4265 - Static typing of K2-FunctionProlog-9
Summary: Static typing of K2-FunctionProlog-9
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Frans Englich
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-19 13:49 UTC by Tim Mills
Modified: 2007-01-23 17:33 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2007-01-19 13:49:31 UTC
The multiplication operator here fails to typecheck becuase local:multiplySequence is typed as item()*.

(:*******************************************************:)
(: Test: K2-FunctionProlog-9                             :)
(: Written by: Frans Englich                             :)
(: Date: 2007-01-15T15:15:45+01:00                       :)
(: Purpose: A recursive function multiplying a sequence. :)
(:*******************************************************:)
declare function local:multiplySequence($input)
{
    if      (empty($input))
    then    1
    else    $input[1] * local:multiplySequence($input[position() != 1])
};
local:multiplySequence((1, 2, 3, 4, 5))
Comment 1 Frans Englich 2007-01-21 12:45:55 UTC
A fix has been attempted in CVS, and XQTS_current.zip has been updated to contain the new change. If it can be verified that the change is correct, it would be appreciated.

If this resolution is satisfiable, feel free to change status to closed. Otherwise, reopen this report. If no opinion on the resolution is expressed within two weeks, I will change status to closed.

This change to this report was part of a batch-change of several reports.
Comment 2 Tim Mills 2007-01-22 08:49:36 UTC
This still fails.  I suggest:

declare function local:multiplySequence($input as xs:integer*) as xs:integer

which ensures that the multiplication operator will type check correctly.
Comment 3 Frans Englich 2007-01-23 16:20:20 UTC
A new attempt has been committed to CVS(see comment #1).
Comment 4 Tim Mills 2007-01-23 17:33:30 UTC
K2-FunctionProlog-9 is now fixed.  Thanks.