Bug 19479 - [QT3TS] CastAsNamespaceSensitiveType-2, 4
[QT3TS] CastAsNamespaceSensitiveType-2, 4
Status: CLOSED FIXED
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite
Working drafts
PC Windows NT
: P2 normal
: ---
Assigned To: O'Neil Delpratt
Mailing list for public feedback on specs from XSL and XML Query WGs
:
: 19480 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-11 16:31 UTC by Tim Mills
Modified: 2012-11-08 14:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Mills 2012-10-11 16:31:13 UTC
In CastAsNamespaceSensitiveType-2 and 5, there are mismatched ')' at the end of each test.
Comment 1 O'Neil Delpratt 2012-11-07 23:18:31 UTC
Bug in test case CastAsNamespaceSensitiveType-2 has been fixed by Michael Dyck. However, I Cannot see a problem with CastAsNamespaceSensitiveType-4 and CastAsNamespaceSensitiveType-5
Comment 2 Tim Mills 2012-11-08 10:54:20 UTC
CastAsNamespaceSensitiveType-2 is fixed.  Thanks.

CastAsNamespaceSensitiveType-4 has a type check error:

      declare function local:clarkname($q as xs:NOTATION) as xs:string {
        $q
      };
      local:clarkname(xs:untypedAtomic("xs:integer"))

$q is declared as an xs:NOTATION.  
The return type of the function is xs:string.
Function conversion rules cannot convert an xs:NOTATION into an xs:string.

Thus this test should expect XPTY0004, since this condition can be detected statically.

CastAsNamespaceSensitiveType-5 has a similar problem.
Comment 3 Tim Mills 2012-11-08 10:55:23 UTC
I suspect that changing the function definition to:

declare function local:clarkname($q as xs:NOTATION) as xs:string {
        $q cast as xs:NOTATION
      };

will solve the problem.
Comment 4 O'Neil Delpratt 2012-11-08 12:57:52 UTC
(In reply to comment #2) 
> Thus this test should expect XPTY0004, since this condition can be detected
> statically.

According to the spec in Section 3.16:
In addition, the target type cannot be xs:NOTATION xs:anySimpleType, or xs:anyAtomicType [err:XPST0080]

Therefore, should the error code be XPST0090 instead of XPTY0004
Comment 5 O'Neil Delpratt 2012-11-08 13:03:06 UTC
I suspect the intended change to the function definition should be:
declare function local:clarkname($q as xs:NOTATION) as xs:string { 
        $q cast as xs:string
};

I have made the change to CastAsNamespaceSensitiveType-4 and CastAsNamespaceSensitiveType-5
Comment 6 O'Neil Delpratt 2012-11-08 14:26:42 UTC
*** Bug 19480 has been marked as a duplicate of this bug. ***
Comment 7 Tim Mills 2012-11-08 14:43:50 UTC
Confirmed fixed.  Thanks.