Bugs item #1559355, was opened at 2006-09-15 16:15
Message generated for change (Comment added) made by teubner
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: 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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to