Bug #5587
closed
Dynamic calls on integrated extension functions with multiple arity
Category:
Saxon extensions
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Description
When an extension function (implementing the interface ExtensionFunctionDefinition
) allows multiple arities (minimum number of arguments != maximum number of arguments), dynamic function calls on the function fail. This applies both to static lookup of the function (my:func#2
) and to dynamic lookup (function-lookup(QName($ns, 'func'), 2)
).
Reported at https://saxonica.plan.io/boards/3/topics/8869.
Unit tests added to TestIntegratedFunctions.java, initially on the 12.x branch.
- Status changed from New to Resolved
- Applies to branch 11, trunk added
- Fix Committed on Branch 11, trunk added
- Platforms .NET added
Fixed.
To allow dynamic calling, the ExtensionFunctionCall object needs to know the actual arity of the function, rather than inferring it either from the function definition or from the function call.
The code path is the same for both the static binding (my:fn#1
) and the dynamic binding (function-lookup(QName(..), 1
)
- Platforms Java added
- Platforms deleted (
.NET)
- Status changed from Resolved to In Progress
Resolved for SaxonJ; needs testing also in SaxonCS.
I added corresponding tests for SaxonCS and found that the Java patch was sufficient to make the dynamic calls work.
However, I found a separate problem with static calls on a C# extension function declared with variable arity: The class ExtensionFunctionDefinitionWrapper.cs
needs to implement the methods getMinimumNumberOfArguments()
and getMaximumNumberOfArguments()
.
- Status changed from In Progress to Resolved
- Platforms .NET added
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.4 added
Bug fix applied in the Saxon 11.4 maintenance release.
Please register to edit this issue
Also available in: Atom
PDF