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 3823 - Static typing of K-StringToCodepointFunc-8
Summary: Static typing of K-StringToCodepointFunc-8
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.1
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: 2006-10-13 12:57 UTC by Nick Jones
Modified: 2007-01-15 10:55 UTC (History)
0 users

See Also:


Attachments

Description Nick Jones 2006-10-13 12:57:58 UTC
This test:

string-to-codepoints("e") eq 101

does not static type check as the types are

LHS: interger*
RHS: anyAtomicType?

As has happened with similar cases, could "101" be set as the expected result for the test harness to check, rather than doing such a test in the query.
Comment 1 Frans Englich 2006-10-13 13:29:17 UTC
Yes, that is a good fix to this problem.
Comment 2 David Carlisle 2006-10-13 13:57:42 UTC
(In reply to comment #1)
>> for the test harness to check, rather than doing such a test in the query.

> Yes, that is a good fix to this problem.
> 

It avoids the problem, but it does highlight that there is something deeply worrying about the current definition of XQuery if static typing is enabled, that it is so much more convenient to compare two XQuery values for equality -outside- of XQuery, rather than compare them using any expression within the defined XQuery language.

David
Comment 3 Michael Kay 2006-10-13 14:05:47 UTC
>It avoids the problem, but it does highlight that there is something deeply worrying about the current definition of XQuery if static typing is enabled, that it is so much more convenient to compare two XQuery values for equality
-outside- of XQuery, rather than compare them using any expression within the defined XQuery language.

Well, that's not quite true. You could compare them using "=". After all, "eq" was invented largely in order to allow the system to throw static type errors, so people who use it get what they deserve.

I do agree that all these bugs are tending to make me more and more convinced that static typing is a bad idea.

Michael Kay
Comment 4 Frans Englich 2006-10-13 15:09:49 UTC
Another scary thing is that we previously have had two-three vendors running the test suite with static typing implementations but haven't reported the ones we've received lately(although they have reported on other stuff). That tells a bit about the interoperability of static typing implementations.
Comment 5 Andrew Eisenberg 2006-10-13 18:51:13 UTC
Comment 1 says:

LHS: interger*
RHS: anyAtomicType?

The RHS is an integer literal, with type xs:integer.

Replacing eq with = is the easy fix for this bug.
Comment 6 Nick Jones 2006-10-13 23:41:55 UTC
(In reply to comment #5)
Ah, sorry, when I said LHS and RHS what I actually meant was the actual and expected type parameters of the created fs:convert-operand expression.

Replacing eq with =, or moving the check to the test harness both sound equally good to me.
Comment 7 Frans Englich 2007-01-12 18:52:34 UTC
An attempted fix has been committed to CVS, and should be part of XQTS_current.zip. Feel free to verify that the fix is acceptable, and if so, change status to CLOSED. If the attempted fix is not acceptable, reopen this report.

If no opinion about this resolution is expressed within two weeks, it will be closed.

Along with the fix for this report, was committed fixes for other reports as well. Also, a significant amount of new tests were added to cover missing areas and changes in the specifications.