Bugs item #1559355, was opened at 2006-09-15 16:15
Message generated for change (Comment added) made by stmane
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1559355&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: PF/compiler
Group: Pathfinder 0.16
Status: Closed
Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: Maurice van Keulen (mvankeulen)
Assigned to: Jens Teubner (teubner)
Summary: XQ: Type error with typeswitch-expression

Initial Comment:
The query below gives a type error: "ERROR = !type
error: can't cast type 'node?' to type 'element { item* }'
!# halted in milprint_summer.c (simplifyCoreTree), line
8956

declare function xmltopxml($node as node()?)
{
   typeswitch($node)
      case $n as element() return <foo>{$n}</foo>
      default return <foo/>
};
xmltopxml(<a/>)

----------------------------------------------------------------------

>Comment By: Stefan Manegold (stmane)
Date: 2007-04-21 19:23

Message:
Logged In: YES 
user_id=572415
Originator: NO

Since this has been closed with "Won't fix",
shall we still keep the failing test (to remind us),
or should we rather disable the test (to reduce the "noise" in the
TestWeb)?

http://monetdb.cwi.nl/testing/projects/monetdb/Current/pathfinder/.mTests103/GNU.32.32.d-Fedora6/tests_BugTracker/type_error_with_typeswitch.SF-1559355.out.00.html
http://monetdb.cwi.nl/testing/projects/monetdb/Current/pathfinder/.mTests103/GNU.32.32.d-Fedora6/tests_BugTracker/type_error_with_typeswitch.SF-1559355.err.00.html


----------------------------------------------------------------------

Comment By: Jens Teubner (teubner)
Date: 2007-02-20 15:36

Message:
Logged In: YES 
user_id=731390
Originator: NO

This is another instance of the
milprint_summer-wrongly-inspects-static-type-information-and-wrongly-interprets-Core-seqcast-nodes
problem and there is probably no sensible way of fixing this.

In this query, the corresponding Core tree contains the explicit
information that $n should be bound to the value of $node, but should have
the *static* type element() (and the typeswitch clause ensures that this
assumption on the static type is always valid).  This should be a
compile-time information only, but milprint_summer wrongly interprets it as
a real cast and complains that it cannot cast to element {}.  The "fix"
would be to implement `seqcast' operators as no-ops in milprint_summer---a
"fix" that would stir up a hornet's nest only.


----------------------------------------------------------------------

Comment By: Sjoerd Mullender (sjoerd)
Date: 2007-02-19 15:55

Message:
Logged In: YES 
user_id=43607
Originator: NO

Jens, is this something for you?  Feel free to assign to somebody else.

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2006-09-27 19:37

Message:
Logged In: YES 
user_id=572415

test added in 
pathfinder/tests/BugTracker/Tests/type_error_with_typeswitch.SF-1559355.xq

(correct/expected output needs to be provided by hand or
approved once the bug is fixed)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1559355&group_id=56967

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to