Public bug reported:

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".

** Affects: zorba
     Importance: Undecided
     Assignee: Markos Zaharioudakis (markos-za)
         Status: New

** Changed in: zorba
     Assignee: (unassigned) => Markos Zaharioudakis (markos-za)

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/854506

Title:
  type errors cause ugly error msgs

Status in Zorba - The XQuery Processor:
  New

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".

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/854506/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to