zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #08659
[Bug 862971] Re: No error upon (almost) duplicate function declarations
// 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";
foo:f(1)
// result
</tmp/foo.xq>:3,9: Zorba error [zerr:ZXQP0008]: "{http://www.foo.com}f#1": function implementation not found; raised at /Users/pjl/src/flwor/zorba/repo/trunk/zorba/src/compiler/translator/translator.cpp:3328
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.
https://bugs.launchpad.net/bugs/862971
Title:
No error upon (almost) duplicate function declarations
Status in Zorba - The XQuery Processor:
Incomplete
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:
https://bugs.launchpad.net/zorba/+bug/862971/+subscriptions
References