Project

Profile

Help

Bug #6594

open

Reflexive access to overloaded methods in Saxon 10 on .NET Framework

Added by Michael Kay 2 months ago. Updated 2 months ago.

Status:
In Progress
Priority:
Low
Assignee:
Category:
.NET API
Sprint/Milestone:
-
Start date:
2024-11-20
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
10
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
.NET

Description

When attempting to call a non-static method using the clitype: mechanism in Saxon 10 on .NET Framework, if the method is overloaded (two methods on the class with the same number of arguments), Saxon rejects both overloads saying (in the -TJ trace output)

Arguments cannot be converted to required types

See https://saxonica.plan.io/boards/3/topics/9759?r=9788

The problem is that if the method reference is ambiguous, Saxon calls DotNetExtensionLibrary.getBestFit(), which assesses the suitablity of each of the supplied arguments, including the first, which should evaluate to an instance of the target class. But the test for this argument in getConversionPreference() is going to return -1, indicating that no conversion is possible. Specifically, the required type will be DotNetExternalObject, and getPrimitiveType() on this returns StandardNames.XS_ANY_ATOMIC_TYPE, for which there is no entry in the "switch" expression in getConversionPreference().

Although this is a significant bug, Saxon 10 on .NET Framework is a bit of a dead end, so the chances of producing a fix are fairly slender.

Please register to edit this issue

Also available in: Atom PDF