// foo.xq

module namespace foo = "http://www.foo.com";;

declare function foo:f( $i as xs:integer ) external;

declare function foo:f( $i as xs:integer ) { 
  $i + 2 

// test.xq

import module namespace foo = "http://www.foo.com"; at "/tmp/foo.xq";

// result
</tmp/foo.xq>:3,9: Zorba error [zerr:ZXQP0008]: "{http://www.foo.com}f#1": 
function implementation not found; raised at 

If you reverse the order of the function declarations (put the external
one last), the query runs to completion without error and produces the
expected result of "3".

In either case, it should instead complain that the same function has
been multiply defined.

You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.

  No error upon (almost) duplicate function declarations

Status in Zorba - The XQuery Processor:

Bug description:
  If you declare two XQuery functions that have the same name and
  signature (arity) in the same file, but the first is declared
  "external" and the second one isn't, Zorba allows the second
  declaration. It should be reported as an error.

To manage notifications about this bug go to:

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