This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In bug#3345 a list of tests was given that had problems with static typing. By far most of these have been resolved in XQTS_current.zip v1.10. However, some of the current queries still have problems. I guess most of these can be solved by adding (or moving) a 'treat as' clause as was also done for the queries in bug#3345. This is the new list: K-EncodeURIfunc-6.xq K-EscapeHTMLURIFunc-6.xq K-CondExpr-4.xq K-LogicExpr-27.xq K-GenCompEq-34.xq K-GenCompEq-35.xq K-FilterExpr-51.xq K-FilterExpr-52.xq K-SeqInsertBeforeFunc-17.xq K-SeqInsertBeforeFunc-18.xq K-SeqInsertBeforeFunc-19.xq K-SeqInsertBeforeFunc-20.xq K2-FunctionProlog-8.xq Thanks, Tom.
Hi Tom, Could you elaborate on what's wrong with K2-FunctionProlog-8? Things might have gotten out of sync, so I post here the query that I associate K2-FunctionProlog-8 with: --------------------------------------------------------- declare function local:myFunction($arg) { if($arg eq 1) then $arg else local:myFunction3($arg - 1) }; declare function local:myFunction2($arg) { local:myFunction($arg) }; declare function local:myFunction3($arg) { local:myFunction2($arg) }; local:myFunction3(3) eq 1 ---------------------------------------------------------
Hi Frans, The problem is that the input and output parameters of the user defined functions are not typed explicitely. Therefor they become item()* and we get the error: Error at line 21, column 25. Static type error. Types 'item()*' and 'xs:integer' are invalid argument types for binary operator 'eq' Since the query tests 'recursive function stretching through several function calls' I guess you don't harm the purpose of the test by adding type declarations explicitely. The following query resolves the problem and gives 'true' as result: declare function local:myFunction($arg as xs:integer) as xs:integer { if($arg eq 1) then $arg else local:myFunction3($arg - 1) }; declare function local:myFunction2($arg as xs:integer) as xs:integer { local:myFunction($arg) }; declare function local:myFunction3($arg as xs:integer) as xs:integer { local:myFunction2($arg) }; local:myFunction3(3) eq 1 Hope this helps... Thanks, Tom.
Ok, thanks for the clarification. * AdditionalFiles/submission-frans.zip contains fixes(or rather, attempts) for the K-* tests * AdditionalFiles/submission-frans2.zip contains K2-FunctionProlog-8 altered as suggested. Note that XQTS_current.zip doesn't contain these changes. I'm resolving this bug, and we'll see if any further fixes are necessary. Frans
Frans, I just checked XQTS_current.zip v1.12 and two items remain for this bug: 1) K2-FunctionProlog-8: ----------------------- The query was changed into: declare function local:myFunction($arg) as xs:integer { if($arg eq 1) then $arg else local:myFunction3($arg - 1) }; declare function local:myFunction2($arg) as xs:integer { local:myFunction($arg) }; declare function local:myFunction3($arg) as xs:integer { local:myFunction2($arg) }; local:myFunction3(3) eq 1 As you can see the function arguments are still not typed resulting in a Static Type error. Is it possible to add the type declarations as suggested before to the arguments too? 2) K-GenCompEq-34: ------------------ Still has a Static Typing issue. Can it be changed similar to K-GenCompEq-35 by adding XPST0004 as expected result? The rest of the list is OK! I hope I'm not too late to get this into XQTS 1.0. Thanks, Tom.
Yupp, sorry about my sloppiness. Fixed in CVS. I think it will go into 1.0, we're just wrapping it. So, let's make a new attempt at closing this one! Frans
Fixes were verified and everything is OK now (XQTS_current.zip v1.14)! Closing.