Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion basex-core/src/main/java/org/basex/query/QueryParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -2580,7 +2580,8 @@ private Expr methodCall(final Expr expr) throws QueryException {
final VarRef arg = new VarRef(info, fr.var);
final FuncBuilder fb = argumentList(false, arg);
if(fb.placeholders != 0) throw error(INVPLACEHOLDER_X, key);
final Lookup func = new Lookup(info, arg, key);
final Lookup val = new Lookup(info, arg, key);
final TypeCheck func = new TypeCheck(info, val, Types.FUNCTION_O);
final Expr call = Functions.dynamic(func, fb);
final GFLWOR gflwor = new GFLWOR(info, fr, call);
localVars.closeScope(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ public final class XQuery4Test extends SandboxTest {
query("declare record local:rect(height, width, area := fn { ?height × ?width }); "
+ "let $r := local:rect(3, 4) return local:rect(5, 6, $r?area)=?>area()", 30);
query("{ 'self': fn { . } }=?>self() => map:keys()", "self");
query("let $f := fn {trace(., \"context\")?i}\n"
query("let $f := fn {?i}\n"
+ "let $g := ({ 'i': 7, 'f': $f }, { 'i': 11, 'g': $f })\n"
+ "let $h := $g?('f', 'g')\n"
+ "return $h[1]($g[1]) * $h[2]($g[2])", 77);

error("(" + rect + "=> map:get('area'))()", INVARITY_X_X);
error(rect + "('area')()", INVARITY_X_X);
error("{} =?> x()", INVCONVERT_X_X_X);
}

/** Otherwise expression. */
Expand Down