BaseXdb / basex

BaseX Main Repository.
http://basex.org
BSD 3-Clause "New" or "Revised" License
695 stars 264 forks source link

XQuery: Updating expressions, type checks, inspect:functions #2221

Closed ChristianGruen closed 3 months ago

ChristianGruen commented 1 year ago
(: 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 commented 11 months ago

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.