This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
XPath30 and XQuery30 section 3.2.2 "Dynamic Function Invocation" say: [Definition: A dynamic function invocation consists of a PrimaryExpr that returns the function item and a parenthesized list of zero or more arguments (argument expressions or ArgumentPlaceholders).] If the PrimaryExpr does not return a sequence consisting of a single function item with the same arity as the number of specified arguments, a type error is raised [err:XPTY0004]. These two occurrences of "PrimaryExpr" are problematic. Consider the section's second example: $f[2]("Hi there") The function item that is invoked is returned by $f[2], which is not a PrimaryExpr. The PrimaryExpr is $f, which does not return a sequence consisting of a single function item. I suggest we change "PrimaryExpr" to "base expression", in parallel with 3.2.1 "Filter Expressions".
I believe this is fixed in the current internal Working Draft.