basex icon indicating copy to clipboard operation
basex copied to clipboard

XQuery: Updating expressions, type checks, inspect:functions

Open ChristianGruen opened this issue 2 years ago • 1 comments

(: a.xqm :)
module namespace a = 'a';
(: b.xqm :)
module namespace b = 'b';
(: c.xqm :)
module namespace c = 'c';
declare %updating function c:a() as empty-sequence() { error(), c:a() };

The following query…

(: main.xq :)
import module namespace c = 'c' at 'c.xqm';
('a.xqm', 'b.xqm') ! inspect:functions(.)

…returns:

[inspect:parse] Stopped at c.xqm, 3/28:
[XUST0001] type check: no updating expression allowed.

ChristianGruen avatar Jun 26 '23 11:06 ChristianGruen

Related (with INLINELIMIT = 0):

(: x.xqm :)
module namespace f = 'f';
declare function f:f() { };
(: x.xq :)
declare function local:a() { current-date()[not(string(.))] };
declare %updating function local:b() { void(local:a()) ,() };
void(inspect:functions('x.xqm')),
local:b()

Unexpected result: Function body must be updating.

ChristianGruen avatar Dec 23 '23 15:12 ChristianGruen