type errors cause ugly error msgs

Bug #854506 reported by David Graf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Medium
Markos Zaharioudakis

Bug Description

A query like this

declare function local:foo() as empty-sequence()
 {
   <foo />
 };

 local:foo();

causes the following error msg because of a type error:

<?xml version="1.0" encoding="UTF-8"?>
</Users/wcandillon/tmp/test.xq>:3,3: type error [err:XPTY0004]: Cannot
treat [NodeXQType elementNode nametest=[uri: , local: foo]
content=[XQType ANY_TYPE_KIND*]] as [XQType NONE_KIND] when returning
the result of the function local:foo().; raised at
/Users/wcandillon/28msec/zorba/src/runtime/core/sequencetypes.cpp:557
=================================================
local:foo#0 <http://www.w3.org/2005/xquery-local-functions>
/Users/wcandillon/tmp/test.xq at line 6 column 1

This is very ugly und not understandable for someone who is not involved in the zorba internals. We need an error msg like this:

Stopped at line 1, column 17: [XPTY0004] Can't promote type xs:string to empty-sequence(): "abc".

David Graf (davidagraf)
Changed in zorba:
assignee: nobody → Markos Zaharioudakis (markos-za)
Changed in zorba:
status: New → In Progress
Changed in zorba:
importance: Undecided → Medium
Changed in zorba:
milestone: none → 2.7
status: In Progress → Fix Committed
Changed in zorba:
milestone: 2.7 → 2.6
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.