Bug #5587
closedDynamic calls on integrated extension functions with multiple arity
100%
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.
Updated by Michael Kay over 2 years ago
- 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
)
Updated by Michael Kay over 2 years ago
- Platforms Java added
- Platforms deleted (
.NET)
Updated by Michael Kay over 2 years ago
- Status changed from Resolved to In Progress
Resolved for SaxonJ; needs testing also in SaxonCS.
Updated by Michael Kay over 2 years ago
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()
.
Updated by Michael Kay over 2 years ago
- Status changed from In Progress to Resolved
- Platforms .NET added
Updated by Debbie Lockett over 2 years ago
- 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